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.

list entries that belong to a certain category name

September 10, 2014 7:49am

Subscribe [3]
  • #1 / Sep 10, 2014 7:49am

    mja388

    6 posts

    I have a category group called “work”. Within that group I have the following category names: silver, gold, platinum.
    I want to have a page that displays all entries that have the “silver” category name assigned to them. Can anyone tell me where I’m going wrong with the following code.
    Thanks in advance.

    {exp:channel:entries channel="work"}
      {exp:channel:categories:silver}
     <a href="http://{title}" class="thumb">{work_image_1}</a>
     <h6 class="heading">{title}</h6></a>
          
      {/exp:channel:categories}
    {/exp:channel:entries}
  • #2 / Sep 10, 2014 9:46am

    deswork

    122 posts

    Have your tried adding

    category_group="cat_group_id"

    to the channel enties tag

    {exp:channel:entries channel="work" category_group="cat_group_id"}
  • #3 / Sep 10, 2014 1:03pm

    mja388

    6 posts

    Thanks for your suggestion Deswork.
    It lead me to try the following which did the job perfectly.

    {exp:channel:entries channel="work" category="3"}

    It seems all I needed was to add the category id.

    category="3"
  • #4 / Sep 15, 2014 6:47am

    Boyink!

    5011 posts

    You could also feed the template the correct URL and the channel entries tag will dynamically pull the proper entries - no hardcoding of category id required.

    I have a “working with categories” video here:
    http://www.train-ee.com/courseware/free-tutorials/comments/working-with-categories/

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

ExpressionEngine News!

#eecms, #events, #releases