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.

(Sub-)Navigation combining categories and entries

October 24, 2007 7:15am

Subscribe [3]
  • #1 / Oct 24, 2007 7:15am

    I’ve a really complex site where it’s necessary to use categories to group entries.

    Now I want to make a simple three-level-navigation tree of categories and entries.
    For example:

    <ul>
      <li>Category 1</li>
      <li class="active-parent">Category 2</li>
      <li>Sub-category 1</li>
        <li class="active-sub">Sub-category 2</li>
          <li>Entry 1</li>
          <li class="active-item">Entry 1</li>
          <li>Entry 1</li>
          <li>Entry 1</li>
        <li>Sub-category 3</li>
      <li>Category 3</li>
    </ul>

    I think I’ll can fix the active layers, but the problem is finding out how to create that navigation tree. I also can’t find it on the forums, wiki, KB, docs etc. etc.

    Can someone please help me with this issue? Thanks in advance!

    [Moderator Edit: Moved from Bug Forum to How-to Forum]

  • #2 / Oct 25, 2007 7:21am

    Does anybody have a clue about this issue?

  • #3 / Oct 25, 2007 11:15am

    allgood2

    427 posts

    I’m not certain what your after. But I would assume if you just use the category_archives tag or the categories tag with the default nested style, then your list would generate with categories, and subcategories and sub-sub categories as nested items.

    Also, when you post at 5:15AM in the morning, it isn’t unreasonable to not expect a reply until after the start of the next business day. Lord knows, I spend a number of hours trolling in the early AM, but most people are asleep.

  • #4 / Oct 25, 2007 6:15pm

    Excuse me for losing my patience, because I live in Europe I forgot the time.

    I’m looking for the right solution for mixing categories (including subcategories) and entries for this submenu. Is the category_archives a solution for it?

  • #5 / Oct 25, 2007 7:23pm

    allgood2

    427 posts

    Using the category archives tag like so:

    {exp:weblog:category_archive weblog="english" style="nested"}
    
    {categories}
    <h3>{category_name}</h3>
    <p>{if category_description}{category_description}{/if}<br />
    {/categories}</p>
    
    <p>{entry_titles}<br />
    <a href="http://{path=template_group/template}">{title}</a></p>
    
    <p>{/entry_titles}</p>
    
    <p>{/exp:weblog:category_archive}

    Will get you a template that looks like so test page  These seems like the formatting you want without the ul li classes.  So then it’s just a matter of assigning styles or CSS code.  If that’s not the structure your looking for then I need more details.

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

ExpressionEngine News!

#eecms, #events, #releases