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.

exp:weblog:categories limit

November 05, 2009 6:34pm

Subscribe [2]
  • #1 / Nov 05, 2009 6:34pm

    AngMed

    71 posts

    Hi,
    I wondering of there is already a solution for my question.

    My podcast uses Category for audio series, usually there are 2 series at the same time, so I want to display the current (two) categories (I’ve sorted them manually, the latest on the top). I can’t find anywhere where I can limit to display only the latest two categories.

    This is how I imagine it to work:

    {exp:weblog:categories weblog="audio" limit="2"}
    {category_name}
    {/exp:weblog:categories}

    I can only imagine someone else here in the community have faced similar challenge. Maybe there are a plugin already created? I’ve tried to search for a plugin like that, but can’t find.

    Thanks

  • #2 / Nov 05, 2009 7:01pm

    AngMed

    71 posts

    SOLVED
    I’ve found a solution using Query Module Tags, thanks

  • #3 / Nov 06, 2009 2:10pm

    wecreateyou

    86 posts

    Any chance you’d like to share that query?

    Thanks in advance.

  • #4 / Nov 06, 2009 5:40pm

    AngMed

    71 posts

    {exp:query sql="SELECT cat_name FROM exp_categories WHERE group_id = '2' ORDER BY cat_order ASC LIMIT 2 "}
    {cat_name}
    {/exp:query}

    Group ID 2 is the group i want to use

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

ExpressionEngine News!

#eecms, #events, #releases