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.

Create a list of categories and display entries withing those categories

June 28, 2007 8:06am

Subscribe [3]
  • #1 / Jun 28, 2007 8:06am

    stinhambo

    1268 posts

    the Categories Archive tag doesn’t quite do it for me.

    What I want to do is to display a list of categories (headers) then under each Category, show the entries assigned to each Category.

    It is for a Contact List -

    Department 1 (Category)

    Name
    Phone Number

    Name
    Phone Number

    Department 2 (Category)

    Name
    Phone Number

    I looked through the docs but couldn’t see anything. Then again I am a bit tired… :(

  • #2 / Jun 28, 2007 12:55pm

    Robin Sowell

    13255 posts

    There isn’t a great way to get custom fields into the category archive- but the wiki has a workaround.  It can be a little query intensive for my taste, but it works.

  • #3 / Jun 28, 2007 3:21pm

    Boyink!

    5011 posts

    Robin - I was using the approach you linked to in the Wiki.  It was working on EE 1.5.2. but I just noticed that now that I’ve upgraded to 1.6 it’s not pulling in the weblog entries.

    Here’s the code:

    {exp:weblog:category_archive weblog="chamber_faq" cache="yes" refresh="100"}
            {categories}
                        <h3>{category_name}</h3>
    <p>                        {if category_description}<br />
                                {category_description}<br />
                            {/if}<br />
                          <br />
            <ul class="bullet"><br />
                {exp:weblog:entries weblog="chamber_faq" orderby="title" category="{category_id}" sort="asc"  disable="member_data|trackbacks|pagination"}<br />
                        <li><a href="http://{title_permalink=chamber_faq/answer}">{question}</a></li><br />
                     {/exp:weblog:entries}<br />
        </ul><br />
         {/categories}<br />
    {/exp:weblog:category_archive}

  • #4 / Jun 28, 2007 4:23pm

    Robin Sowell

    13255 posts

    Boyink- are you running the very latest build?  The addition of category custom fields had the first releases dropping single variables that weren’t cat custom fields.  Was addressed in the 20070626- so if you’re later than that, should be ok.  If it’s not- give a yell back.

  • #5 / Jun 28, 2007 4:27pm

    Boyink!

    5011 posts

    Nope - I’ll update the site.  Thanks!

  • #6 / Jun 28, 2007 11:06pm

    stinhambo

    1268 posts

    Thank you Michael! Another one to add to the EE experience bow 😉

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

ExpressionEngine News!

#eecms, #events, #releases