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.

Subcategory and entry list

November 10, 2011 3:15pm

Subscribe [3]
  • #1 / Nov 10, 2011 3:15pm

    EE version 2.2.2

    Here is the overview, I have 5 category groups and and each group has subcategories from 5 to 50. Each entry assigned to multiple subcategories. Using GWcode Categories to list categories and subcategories.

    I am trying to do is on click subcategory it should display list of entries assigned under that subcategory. In a code rather passing category id I want category={segment_3} (which is sub category name) and list all entries assigned to that sub category.

    Please guide me to do it in a right way.

    {exp:channel:entries  channel="test" category="{segment_3}" }
      <a href="http://{title_permalink=test/index}">{title}</a>
    
    {/exp:channel:entries }

    Thanks

  • #2 / Nov 11, 2011 9:05am

    Sue Crocker

    26054 posts

    Hi, fatrabbit.

    What does your url look like when you get to the page you want to get the info from?

  • #3 / Nov 11, 2011 9:33am

    URL looks like - http://www.example.com/test/Topics/aaup
    ‘Topics’ is one of the Category group name.
    ‘aaup’ is one of the subcategory name.
    so on this page I wan to list all the entries title under subcategory ‘aaup’

  • #4 / Nov 14, 2011 9:17pm

    Sean C. Smith

    3818 posts

    fatrabbit,

    You will need to look at a third party add-on to do what you are trying to achieve. The add-on Cat2 looks like it will do what you want with the following code

    {exp:cat2:id category_url_title="my_category" category_group="5"}

    which if placed in the code you shared above would look like this:

    {exp:channel:entries  channel="test" category="{exp:cat2:id category_url_title='segment_3' category_group='5'}" }
      <a href="http://{title_permalink=test/index}">{title}</a>
    
    {/exp:channel:entries }

    be sure to change the category_group=“5” to the category_group id of the category group for that channel. You can find that in admin > channel administration > categories

    Sean

  • #5 / Nov 15, 2011 9:47am

    Thanks. I even found this plugin which gives categories information in the URI, category id or name in segment. low-seg2cat

  • #6 / Nov 15, 2011 11:01am

    Sean C. Smith

    3818 posts

    Awesome, have you resolved your issue then?

  • #7 / Nov 15, 2011 11:36am

    Yes. Thanks again.

  • #8 / Nov 15, 2011 11:38am

    Sean C. Smith

    3818 posts

    Fantastic. I’m going to close this thread now. Feel free to post again as needed.

    Sean

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

ExpressionEngine News!

#eecms, #events, #releases