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.

Help Needed Creating Category Managed Content

March 05, 2012 9:16am

Subscribe [2]
  • #1 / Mar 05, 2012 9:16am

    Scott Harrington

    85 posts

    Hi All, I need some assistance if possible to try and achieve a jQuery accordion system using category controlled channel entries.

    Basically I need the category to output a list of each entry within a channel, when its entered so it creates a list. Below is the static example of what I want to achieve and just need some guidance on how I can get EE to output it correctly.

    So, a channel with 4-5 categories and then each title entry (repeated) added within the list and repeated per category, like so

    <h2 class="serviceheadings accordionButton">{example_category_one}</h2>
           <div class="accordionContent">
            <h3 class="serviceinternal">Lorem Ipsum</h3>
             <ul>
              <li><span>{title}</span></li>       
              <li><span>{title}</span></li>       
              <li><span>{title}</span></li>        
            </ul>
           </div>
          <h2 class="serviceheadings accordionButton">{example_category_two}</h2>
           <div class="accordionContent">
            <h3 class="serviceinternal">Lorem Ipsum</h3>
             <ul>
              <li><span>{title}</span></li>
              <li><span>{title}</span></li>
              <li><span>{title}</span></li>
             </ul>
           </div>

    This is probably straight forward enough but throw categories in to the mix and I just get confused and my brain turns to mush…trying to learn the proper and full use of them as I go along but would appreciate the help in the meantime, to help me get started.

    Thanks guys

  • #2 / Mar 05, 2012 9:48am

    John St-Amand

    865 posts

    If you only need the titles and no other custom fields, category archives will get you a per category list of entries.

  • #3 / Mar 05, 2012 9:58am

    Scott Harrington

    85 posts

    Forgive my ignorance but not put this in to practise yet, so I would output:

    {exp:channel:category_archive channel="my_channel"}
        {categories}
            <h2 class="serviceheadings accordionButton">{category_name}</h2>
    <div class="accordionContent">
            {if category_description}
                <h3 class="serviceinternal">{category_description}</h3>
            {/if}
        {/categories}
       <ul>
        {entry_titles}
            <li><span>{title}</span>
        {/entry_titles}
       </ul>
    </div>
    {/exp:channel:category_archive}
  • #4 / Mar 05, 2012 12:13pm

    John St-Amand

    865 posts

    Yes, that looks like it.

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

ExpressionEngine News!

#eecms, #events, #releases