ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

3-Level-Category Expanding Menu Problem

February 05, 2008 8:28am

Subscribe [3]
  • #1 / Feb 05, 2008 8:28am

    Kippi

    83 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="http://{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-top: 61px;
        padding-left: 0;
        margin-bottom:1px;
        font: normal 12px "Helvetica Neue", Helvetica, Arial, Verdana, Sans-Serif;
    
    }
    
    .nav_categories a {
    
        font-weight: normal; 
        text-decoration:none;
        padding-top:5px;
        padding-bottom:6px;
        display: block;
    }
    
    .nav_categories ul {
        list-style: none;
        padding-left: 0px;
        background: url(menu_over.gif) no-repeat top left
    
    }
    
    .nav_categories li {
        list-style: none;
        text-indent: 4px;
        background: url(menu.gif) no-repeat top left;
    }
    
    .nav_categories li ul {
        list-style: none;
        padding-left:0px;
        background: url(menu_over.gif) no-repeat top left;
    
    }
    
    .nav_categories li ul li {
        list-style: none;
    background: url(menu_down.gif) no-repeat top left;
    font-weight: normal;
    text-indent:12px;
    } 
    
    .nav_categories li ul li ul {
        list-style: none;
        padding-left:0px;
    background: url(menu_over.gif) no-repeat top left;
    }
    
    
    .nav_categories li ul li ul li {
        list-style: none;
        text-indent:12px;
    }
    
    .nav_categories a:link { background-color: transparent; text-decoration: none; color: #000000;
    }
    .nav_categories a:hover { background-color: transparent; text-decoration: none; font-weight: normal; color: #ffffff; background: url(menu_down.gif) no-repeat top left;
    }
    .nav_categories a:active { background-color: transparent; text-decoration: none; font-weight: normal; color: #ffffff;
    }
    .nav_categories a:visited { background-color: transparent; text-decoration: none; font-weight: normal; color: #000000;
    }

    Any pointers?

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

    Thanks!

  • #2 / Feb 05, 2008 9:47am

    silenz

    1651 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.

  • #3 / Feb 05, 2008 10:27am

    Kippi

    83 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.

  • #4 / Feb 05, 2008 11:05am

    silenz

    1651 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.

  • #5 / Feb 05, 2008 12:01pm

    Robin Sowell

    13255 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="http://{path=">{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.

  • #6 / Feb 05, 2008 4:59pm

    Kippi

    83 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

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases