You are not logged in.
HELP ME
Offline
You can see an example of how to check for the active status of navigation in the example site's footer beginning at line 17:
Offline
You can see an example of how to check for the active status of navigation in the example site's footer beginning at line 17:
No works in footer and header
<? $main_nav = $cms->getNavByParent(0,2); ?>
<? foreach ($main_nav as $navItem) { $active = (strpos($current_url,$navItem["link"]) !== false); ?>
<a class="tf-menu <? if ($active) { ?>tf-active<? } ?>" href="<?=$navItem["link"]?>" <?=targetBlank($navItem["link"])?>> <?=$navItem["title"]?></a>
<? } ?>
Offline
Did you set $current_url to be the current URL in your template? If not, it will be an empty string and strpos will always return true.
$current_url = BigTree::currentURL();
Offline
Did you set $current_url to be the current URL in your template? If not, it will be an empty string and strpos will always return true.
$current_url = BigTree::currentURL();
my tempalte
<?
$current_url = BigTree::currentURL();
$home_page = $cms->getPage(0);
if ($bigtree["page"]["id"]) {
$bigtree["page"]["title"] .= " · ".$home_page["nav_title"];
}
?><!DOCTYPE html>
Offline