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.

Filter Channel Entries by Category

August 29, 2010 8:08am

Subscribe [3]
  • #1 / Aug 29, 2010 8:08am

    Robert Mirabito

    58 posts

    Is it possible to filter channel entries by category? So only show entries in a channel that have a certain category?

  • #2 / Aug 29, 2010 11:07am

    Rob Allen

    3105 posts

    Dynamic parameters to the rescue - http://ellislab.com/expressionengine/user-guide/modules/channel/dynamic_parameters.html

    Basic example for dynamic form with categories:

    <form method="post" action="{path='template_group/template_name'}">
    <select name="category">
    {exp:channel:categories channel="your_channel_name" style="linear"}
    <option value="{category_id}">{category_name}</option>
    {/exp:channel:categories}
    </select>
    <input type="submit" value="Go!" />
    </form>

    You’ll need to assign which fields are dynamic in the results template, eg:

    {exp:channel:entries dynamic_parameters="catgeory"}
  • #3 / Aug 30, 2010 4:17pm

    Ingmar

    29245 posts

    Thanks for the assist, bluedreamer. Does that make sense, Robert?

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

ExpressionEngine News!

#eecms, #events, #releases