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.

Dynamically displaying content of a category in a Nav format.

March 21, 2011 4:26pm

Subscribe [2]
  • #1 / Mar 21, 2011 4:26pm

    Eyelevel

    2 posts

    I’m new to EE2, but picking it up pretty fast while building my first site in the CMS.  I do have question for anyone who can answer.  I’m trying to build a nav that holds 4 to 8 entries of a category.

    example:

    Category Name
      entry
      entry
      entry
      entry

    Category Name
      entry
      entry
      entry
      entry

    The problem I’m having is how to dynamically request the entry id of the category.  The way I thought it might work didn’t and I’ve been having a rough time trying to figure it out myself.

    Heres the code I’ got so far.

    <div id="collapsing-nav" class="grid_4">
    {exp:channel:categories channel="work" style="linear"}
                <h6 class="nav-header" id="{category_url_title}_{category_id}"><a href="#">{category_name}:</a></h6>
        {exp:channel:entries channel="work" category_id="{category_id}" }
            {date_heading}
                <ul class="nav-content-area list-items">
            {/date_heading}    
                <a href="http://{permalink=%27work/view}" class="thumb">{project_thumb}</a>
            {date_footer}
                </ul>
            {/date_footer}
        {/exp:channel:entries}
    {/exp:channel:categories}
    </div>

    Thanks in advance

  • #2 / Mar 21, 2011 6:40pm

    Eyelevel

    2 posts

    I’ve figured it out, apparently beating your head against the keyboard IS effective.

  • #3 / Mar 28, 2011 12:20pm

    gazaston

    128 posts

    So what was the problem? And how’s the head? 😉

  • #4 / Mar 29, 2011 3:24pm

    Eyelevel

    2 posts

    <div id="collapsing-nav" class="grid_4">
    <javascripting was here>
                    <h6>Archives</h6>
    <p>                {exp:channel:entries channel="{segment_1}" orderby="entry_date" category={if segment_4 == "{category_title_url}"}"{category_id}"{/if}}<br />
                    {date_heading display="yearly"}<br />
                        <h6 class="nav-header"><a href="#">{entry_date format="%Y"}</a></h6><br />
                        <ul class="nav-content-area list-items"><br />
                    {/date_heading}<br />
                        <li>{categories}{category_name}{/categories}:<a href="http://{url_title_path=thoughts/view/category/{category_url}}"> {title}</a> <br />
     <span class="meta">{entry_date format="%F %j %Y"}</span></li><br />
                    {date_footer display="yearly"}<br />
                        </ul><br />
                    {/date_footer}<br />
                    {/exp:channel:entries}<br />
    </div>

    Here is the working code that does what I want it to, I played with the url segments to dynamically display the category type.
    I think my brain is finally wrapping around how EE works. :D

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

ExpressionEngine News!

#eecms, #events, #releases