1 john Apr 07, 2007 03:16
3 john May 03, 2007 15:44
A selfish BUMP
4 yabba May 03, 2007 16:04
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
¥
5 john May 03, 2007 16:19
Great, I'll give it a spin and yell out either way :)
6 john May 03, 2007 16:46
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 .= '';
}
7 yabba May 03, 2007 16:49
Got a link to where it fails?
¥
8 john May 03, 2007 16:58
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;
}
9 laibcoms May 03, 2007 17:11
This is interesting... I'll give it a spin as well..
10 yabba May 03, 2007 17:13
Muppet wrote:
#cat=1
:|
¥
11 john May 03, 2007 17:15
which means ? :)
12 yabba May 03, 2007 17:18
#cat= is not *quite* the match for id="cat1" ;)
¥
13 john May 03, 2007 18:26
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 :)
14 yabba May 03, 2007 18:40
John wrote:
color:#fd7;
current css wrote:
#bSideBar a {
border-bottom:0pt none;
color:#EEEEEE;
}
;)
¥
15 john May 03, 2007 18:57
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!!