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.

Multiple categories in URL

October 31, 2007 11:07am

Subscribe [1]
  • #1 / Oct 31, 2007 11:07am

    1px Solid

    28 posts

    Is it possible to have a URL that contains more than one category to retrieve posts from those particular categories?

    eg: /blog/category/news+design/

    where ‘news’ is one category and ‘design’ is another, and the plus symbol is the separator??

    I really hope there is a way to do this…

    Cheers.

  • #2 / Oct 31, 2007 11:22am

    Robin Sowell

    13255 posts

    It won’t be recognized as a category title that way automatically.  In order to pass extra categories (i.e., more than one at a time) you’ll need to get creative.  I’ve done it a few ways- prefer to use cat ids, as they’re easier to work with.  But no reason you can’t work around it with cat names.

    But it is custom coding- so I’m going to shift this to ‘How to’ and throw out a few ideas.

    Pass the extra cat(s) as additional segments.  Turn dynamic off, grab all cats, query to find their ids (main reason I prefer ids- no need for this step)- then echo those out (php parsed on input) in the category parameter of your weblog tag.  Or- leave them in one seg- seperate with +, explode on the plus, do your query- echo the resulting ids.

    So- no standard way to do it, but folks have worked around it in various ways.

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

ExpressionEngine News!

#eecms, #events, #releases