2 john Apr 07, 2007 07:30

 
 

A selfish BUMP

If you find this section of the categories plugin ( approx line 290 ) and modify it as follows then you should get the results you want :
		$r .= '" id="cat'.$cat_ID.'">'.format_to_output($cat['cat_name'], 'htmlbody').'</a> <span class="notes">('.$cat['cat_postcount'].')</span>';
		if( in_array( $cat_ID, $cat_array ) )
		{ // This category is in the current selection
			$r .= '*';
		}Totally untested of course :D
¥

Great, I'll give it a spin and yell out either way :)

Nope... I can't get that to work... ( not a surprise ) 
In the head of my _main.php I have
#cat=<?php echo $cat; ?> a {
background:#FFFFF2;
}and in the categories plugin I have
$r .= '" id="cat'.$cat_ID.'">'.format_to_output($cat['cat_name'], 'htmlbody').'</a>';
		if( in_array( $cat_ID, $cat_array ) )
		{ // This category is in the current selection
			$r .= '';
		}
Got a link to where it fails?
¥

Yep... got to wow-factor.com and click on any of the top right Category menu items and compare that to clicking on the menu group below that with all the $disp=, which work fine and highlight the active link.
The embedded css renders as follows...
#disp_posts a {
background:#578;
color:#fd7;
border-left:4px solid #D95;
}
#cat=1 a {
background:#578;
color:#fd7;
border-left:4px solid #D95;
}
This is interesting... I'll give it a spin as well..

Muppet wrote:
#cat=1
:|
¥

which means ? :)

#cat= is not *quite* the match for id="cat1" ;)
¥

OK... I can generate 
#cat1 {
background:#578;
color:#fd7;
border-left:4px solid #D95;
}
with...
#cat<?php echo $cat; ?> {
background:#578;
color:#fd7;
border-left:4px solid #D95;
} 
and this gives me an "active"  background .
Now I just have to tweak to get "active" text ....
Slowly the penny drops :)

John wrote:
color:#fd7;
current css wrote:
#bSideBar a {
border-bottom:0pt none;
color:#EEEEEE;
}
;)
¥

These lists are in #bSideBar .bSideItem a{} although they are a convoluted mess right now :)
In the end I compromised ..... Thanks for the subtle tips Killer , much appreciated.
Updated:  Fully functional Active state for Categories.
Just edited the CSS in the head of _main.php
#bSideBar .bSideItem #cat<?php echo $cat; ?> {
color:#fd8;
background:#578;
border-left:1px solid #fd8;
}
The reason I ask is because the excellent method provided by Danny in this post
http://forums.b2evolution.net/viewtopic.php?t=8042
doesn't work anymore !!!
Maybe I've stuffed up but I can't find the problem!!