I thought I had this mod complete, with internal links in the ez-pages menus highlighting correctly when active, but have discovered a situation that I can't explain.
This is the function:
PHP Code:
//call as active_page_class($var_linksList[$i]['id'],$var_linksList[$i]['altURL']);
function active_page_class($ezpid,$alturl) {
global $this_is_home_page;
$active = '';
if($_GET['main_page'] == 'page') {
$active = ($_GET['id'] == $ezpid)? ' class="activeEZPage"': '';
}elseif($alturl) {
$alturl = str_replace(HTTP_SERVER . DIR_WS_CATALOG,'/',$alturl);
$active = ((strstr($_SERVER['REQUEST_URI'],$alturl) and !strstr('/index.php?main_page=index',$alturl)) or ($this_is_home_page and strstr('/index.php?main_page=index',$alturl)))?' class="activeILPage"': '';
}
return $active;
}
I have discovered that the two demo category pages I have enabled for footer links do not highlight when active.
Debug output gives this:
uri:/fr-zc139gfresh/index.php?main_page=index&cPath=3_10
alt:/index.php?main_page=index&cPath=3_10
The
$active = ((strstr($_SERVER['REQUEST_URI'],$alturl)
should be finding the relative link ($alturl) in $_SERVER['REQUEST_URI']. It is clearly there when the strings are echoed, but echoing the strstr() as shown gives null. I am at a loss to understand why these two apparently identical string parts are not being found to match.
I observe that these links contain an & while none of the correctly functioning ones do. Could this be related to the v1.3.9g HTML bug? (My local test site is currently v1.3.9g.) I have not edited anything in admin beyond the essentials.
One of the links which I opened to set the footer display (possibly more than once) now shows in view source
/index.php?main_page=index&amp;cPath=21">Gift Certificates</a>
while the other shows the correct
/index.php?main_page=index&cPath=3_10">Action DVDs</a>
Neither of them highlights; of course, the defective one does not link correctly.
Bookmarks