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.

Displaying entries by category causing problems...

July 05, 2010 8:28pm

Subscribe [3]
  • #1 / Jul 05, 2010 8:28pm

    stamper

    25 posts

    Hi All…

    On my blog I have all my entries displaying as well as a list of all the associated categories. Obviously, the idea being when you click on a link to the category, it will show all the related entries for that category.

    The problem is - when you click on the category link, it displays ALL entries (regardless of category).

    On my blog page, I have this:

    {exp:weblog:entries weblog="blog" limit="5" paginate="bottom" category="not 23"}

    If I take out the

    category="not 23"

    then the category links work just fine (ie, only display the related entries). Leave it in - and it displays all entries.

    This is the code I am using to display the categories:

    {exp:weblog:categories weblog="blog" style="linear" show="not 23"}<li><a href="http://{path=blog}">{category_name}</a></li>{/exp:weblog:categories}

    And here is a link to the page in question:

    http://www.jessmarksphotography.com.au/blog

    THanks!

  • #2 / Jul 05, 2010 8:46pm

    Brandon Jones

    5500 posts

    Hi stamper,

    This sounds like the expected behavior. From the documentation on the category parameter:

    Note:Using this parameter will automatically cause ExpressionEngine to ignore any category information specified via the URL. For instance, if you are on a “category page” (e.g. a “/C13/” segment in the URL) that will be completely ignored in favor of whatever you have specified via the parameter.

    Make sense?

  • #3 / Jul 05, 2010 9:00pm

    stamper

    25 posts

    Thanks for the speedy reply… 😊

    Make sense…. haha.. umm.. not really. I did actually read that just before posting.. but could not make sense of what it was meaning. To me, it seems to say: “if you use “category = not” then, you can not display a page of category related articles”. - But surely I am misunderstanding?

    So then, how do I have a page of articles that don’t include Category 23 - and then display a list of categories, that don’t include Category 23 that when clicked on, will give me a page of articles just for that category? IN other words, how do I make this work?

  • #4 / Jul 06, 2010 1:58am

    John Henry Donovan

    12339 posts

    stamper,

    Ok so you have 2 templates right?

    Your template group is called ‘blog’ and you have an ‘index’ and a ‘category’ template?

    On your index template add

    {exp:weblog:entries weblog="blog" limit="5" paginate="bottom" category="not 23"}

    and

    {exp:weblog:categories weblog="blog" style="linear" show="not 23"}<li><a href="http://{path=blog}">{category_name}</a></li>{/exp:weblog:categories}

    On your category template add the following without the category parameter

    {exp:weblog:entries weblog="blog" limit="5" paginate="bottom"}


    Is this the set-up you have?

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

ExpressionEngine News!

#eecms, #events, #releases