EllisLab text mark
Advanced Search
     
3-Level-Category Expanding Menu Problem
Posted: 05 February 2008 08:28 AM
Joined: 2002-06-17
118 posts

Hi,

I am using the 3-Level-Category Expanding Menu by Silenz and it works fine until you go the a single entry.

The menu highlights when you are on the category page but if you go to a single entry the category menu no longer highlight.

The code I am using is:

{exp:cat_expand:wrapper}
{exp
:weblog:categories weblog="{my_weblog}" style="nested"}
{exp
:cat_expand:expander category="{category_id}" active-style="color: #000000; font-weight:normal;  background: url(menu_over.gif) no-repeat top left; text-decoration: none;"}
<a href="{path={my_template_group}/index}">{category_description}</a>
{/exp:cat_expand:expander} 
{
/exp:weblog:categories}
{
/exp:cat_expand:wrapper} 

The css is:

.nav_categories {
    position
:relative;
    
width:199px;
    
margin-left: -10px;
    
margin-top61px;
    
padding-left0;
    
margin-bottom:1px;
    
fontnormal 12px "Helvetica Neue"HelveticaArialVerdanaSans-Serif;

}

.nav_categories a {

    font
-weightnormal
    
text-decoration:none;
    
padding-top:5px;
    
padding-bottom:6px;
    
displayblock;
}

.nav_categories ul {
    
list-stylenone;
    
padding-left0px;
    
backgroundurl(menu_over.gifno-repeat top left

}

.nav_categories li {
    
list-stylenone;
    
text-indent4px;
    
backgroundurl(menu.gifno-repeat top left;
}

.nav_categories li ul {
    
list-stylenone;
    
padding-left:0px;
    
backgroundurl(menu_over.gifno-repeat top left;

}

.nav_categories li ul li {
    
list-stylenone;
backgroundurl(menu_down.gifno-repeat top left;
font-weightnormal;
text-indent:12px;


.nav_categories li ul li ul {
    
list-stylenone;
    
padding-left:0px;
backgroundurl(menu_over.gifno-repeat top left;
}


.nav_categories li ul li ul li {
    
list-stylenone;
    
text-indent:12px;
}

.nav_categories a:link { background-colortransparenttext-decorationnonecolor#000000;
}
.nav_categories a:hover { background-colortransparenttext-decorationnonefont-weightnormalcolor#ffffff; background: url(menu_down.gif) no-repeat top left;
}
.nav_categories a:active { background-colortransparenttext-decorationnonefont-weightnormalcolor#ffffff;
}
.nav_categories a:visited { background-colortransparenttext-decorationnonefont-weightnormalcolor#000000;

Any pointers?

Is there a better way of setting up 3-Level-Categories so it will work?

Thanks!

 
Posted: 05 February 2008 09:47 AM   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2006-10-22
1643 posts

Hard to say without something to look at.
Have you got more than one entry per category? The plugin is only designed to work with category-URLs.

 Signature 

utilitEEs - Addons for EE

 
Posted: 05 February 2008 10:27 AM   [ # 2 ]   [ Rating: 0 ]
Joined: 2002-06-17
118 posts

Hi Silenz,

Thanks for reply,

Some categories have more than one entry.

You can see an example here:

http://formi.no/index.php/helsepersonell/id/kliniske_retningslinjer/

Look at the left menu under Kliniske retningslinjer”

“Kommentarer”

Click on “Kommentarer”

So far so good - the menu is highlighted - “Kommentarer”

But if you click “Les mer” and go to the single entry the menu item is no longer highlighted - it actually closes.

 
Posted: 05 February 2008 11:05 AM   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2006-10-22
1643 posts

Yes, that is expected behaviour.

The purpose of that plugin was to create a dynamically expanding menu for single pages.

It depends on the category information in the URL to know on which position in the menu tree it is right now. So it only works with category_requests not with single-entry requests.

I think there are some plugins for nested menus around that work with pages module or the like but I can’t recommend any because I haven’t tested any myself.

Perhaps someone else can give you a hint.

 Signature 

utilitEEs - Addons for EE

 
Posted: 05 February 2008 12:01 PM   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2002-05-20
12643 posts

Yea- I ended up needing this to work on a single entry page, so hacked up one of mine to do it.  It was harder than I expected it to be.  Anyway- this is completely not supported.  At all.  There are a lot of different ways folks might want this to work, and this was hacked to fit a very specific purpose.  But if you want to give it a try, you can.

Basic usage:

{exp:dyno_cat:categories weblog="experts" show_empty="no" group_id="6" status="open" default_parent_only="yes" disable="count"}
{if c_current_category}
<b>{/if}<a href="{path="essential_knowledge/list"}">{category_name}</a>{if c_current_category}</b>{/if}
{
/exp:dyno_cat:categories} 

But since it’s not supported?  I’d only use it if you’re comfortable poking code.  If you are- feel free to take it as a starting point and do whatever you like with it.

File Attachments
pi.dyno_cat.php.zip  (File Size: 8KB - Downloads: 187)
 Signature 
 
Posted: 05 February 2008 04:59 PM   [ # 5 ]   [ Rating: 0 ]
Joined: 2002-06-17
118 posts

Hi, Thanks for the reply.

I donĀ“t think this really does what I need.
I gave it a try but managed to add the category name with the basic categories tag

{exp:weblog:entries weblog="my_weblog"}{categories}{category_name}{/categories}{/exp:weblog:entries} 

Would still like to try to get the actual menu to highlight but this will do until I find a way to do this.

regards, Kippi