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.

EE automatically adds a class of nav_categories to generated ul's

January 28, 2011 10:25am

Subscribe [3]
  • #1 / Jan 28, 2011 10:25am

    welshartnow

    81 posts

    My issue is the same as this thread http://ellislab.com/forums/viewthread/164457/ I wish to place two category menus on the same page and am getting validation errors due to the fact that the id nav_categories is being generated twice by EE2.x.  Not sure how this guy got around the problem any help welcomed.

    {exp:channel:categories channel="offices"  class="subnav" [color=red]id="dummy1"[/color] } 
        <a href="http://{path=%27portal/offices%27}">{category_name}</a> 
        {/exp:channel:categories}
        
            
            
         <div class="section_name">
          <center>
            <h2>Sales Offices</h2>
    <p>      </center><br />
        </div><br />
        {exp:channel:categories channel="offices"  class="subnav" id="dummy2" } <a href="http://{path=%27portal/offices%27}">{category_name}</a> {/exp:channel:categories}

  • #2 / Jan 29, 2011 2:40pm

    Greg Salt

    3988 posts

    Hi welshartnow,

    You can specify which ID and class should be applied to each nested UL. The documentation has examples of how you do this.

    Cheers

    Greg

  • #3 / Jan 31, 2011 7:02am

    welshartnow

    81 posts

    Thank you Greg and to the originator of the thread who also helped.  This does work, if you wish to include more than one category menu on the same page assign dummy id’s to each of your category menus, ie id=“dummy1”, id=“dummy2”. See code below.  This has the effect of writing any id’s generated by EE

  • #4 / Feb 01, 2011 2:57am

    John Henry Donovan

    12339 posts

    Glad that worked for you. Feel free to start a new thread if you have any more questions

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

ExpressionEngine News!

#eecms, #events, #releases