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.

show channel entries in category X or Y

April 02, 2011 10:25am

Subscribe [2]
  • #1 / Apr 02, 2011 10:25am

    goodbytes

    49 posts

    I’m adding entries to a channel called “fotos” in different categories.

    Now I just want to be able to filter these entries based on the current category a user is browsing.

    {exp:channel:entries channel="fotos"}
          <li>{foto}</li>
    {/exp:channel:entries}

    The code above just shows all entries, disregarding the parameter I give in my url like this:

    http://www.domain.local/multimedia/fotos/category/categoryname

    Do I need to tell EE how to filter on the given categoryname? I have double checked that the category name exists and that the “category” word has been set as the “Category URL Indicator”

    Thanks for helping me out here!

  • #2 / Apr 04, 2011 4:01am

    John Henry Donovan

    12339 posts

    goodbytes,

    that should work for you. If you add the category heading tag to your template does it display the correct heading for each category you visit? Add this outside the channel:entries tag

    {exp:channel:category_heading channel="fotos"}
    
    <h1>{category_name}</h1>
    
    {/exp:channel:category_heading}
  • #3 / Apr 04, 2011 4:21am

    goodbytes

    49 posts

    Thanks for getting back to me.
    That doesn’t seem to work when building url’s like this:

    http://www.domain.local/multimedia/fotos/category/mycategory

    however, this works:

    http://www.domain.local/multimedia/fotos/C2

    Any ideas how I can make it work with the clean url structure instead of C2?

  • #4 / Apr 06, 2011 4:05am

    John Henry Donovan

    12339 posts

    goodbytes,

    Head to your Global Channel Preferences and turn on Use Category URL Titles In Links?
    Admin > Channel Administration > Global Channel Preferences

    does that help?

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

ExpressionEngine News!

#eecms, #events, #releases