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.

I need help displaying entries by nested category

January 24, 2008 7:46pm

Subscribe [2]
  • #1 / Jan 24, 2008 7:46pm

    Adam McIsaac

    8 posts

    Okay, I’ve spent the past couple of hours poking through the docs and forums looking for an answer and haven’t found it, so apologies in advance for what may be a total n00b rtfm moment.

    I’m trying to display entries by nested category, e.g.:

    Category name
      Category description
    Subcategory name
      Subcategory description
      Entry
      Entry
    Subcategory name
      Subcategory description
      Entry
      Etc, etc.
     
    I’d like to do this without hard-coding separate category pages. I have it working with the parent levels just fine—navigation rendered just from the {categories} tag takes the user to the appropriate category page, wherein all of the entries related to that category are displayed properly.

    The problem I have is with the child categories. I can’t figure out how to get them to group properly and render the proper heading. Can it be done?

    Here’s the code I’m using, minus the HTML entities:

    <—Master header—>

    {exp:weblog:category_heading weblog="resources"}
      {category_name}
    {/exp:weblog:category_heading}

    <—Entries—>
     
    {exp:weblog:entries weblog="resources" orderby="url_title" sort="asc"}
      {title}
      {resource_description}
      {resource_link}
    {/exp:weblog:entries}

    Total vanilla action, renders all of the entries assigned to the parent level (including the children). Does anyone know how I can sort them properly?

    Thanks for any help.

    Kind regards,

    Adam McIsaac

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

ExpressionEngine News!

#eecms, #events, #releases