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.

URL with both category and month/year segments?

November 29, 2008 8:43pm

Subscribe [2]
  • #1 / Nov 29, 2008 8:43pm

    knite

    20 posts

    I have a normal {exp:weblog} tag which I would like to filter by both category and date, dynamically.

    http://mysite.com/index.php/weblog/category/cat_name works.

    http://mysite.com/index.php/weblog/2008/11 works.

    http://mysite.com/index.php/weblog/category/cat_name/2008/11 doesn’t work.

    http://mysite.com/index.php/weblog/2008/11/category/cat_name doesn’t work.

    Is there a way to do this? I’ve already searched the forums, wiki and documentation, but can’t find anything about it. I’m guessing there’s a note about this somewhere that I just haven’t come across yet.

  • #2 / Nov 29, 2008 9:01pm

    knite

    20 posts

    I must have had a typo somewhere, because I just tried again - http://mysite.com/index.php/weblog/category/cat_name/2008/11 works!

    But!

    Is there a way to nicely generate this type of link? {path} will append your category inside {exp:weblog:categories}, but doesn’t append existing URL segments. I could construct the URL myself, but that seems like a bit of a hack…

  • #3 / Nov 30, 2008 3:59pm

    Greg Aker

    6022 posts

    knite:

    Are you using a weblog categories tag pair?  If so, maybe using the {category_url_title} parameter can help you get started.

    -greg

  • #4 / Dec 01, 2008 11:27am

    knite

    20 posts

    {exp:weblog:categories weblog="events" style="linear"}<a href="http://{path=%27plain/calendar%27}{if">{category_name}</a>

    That’s the code I’m using right now. Ugly, but it works. Is there a cleaner way to do this?

    Also, my code as originally written used double-quotes for both != checks. It did not display correctly in this post inside a code block.

  • #5 / Dec 01, 2008 4:44pm

    Ingmar

    29245 posts

    This is certainly one way of doing it. As always, there are multiple approaches. Would you want me to move this over to Howto for further discussion, or do you consider the issue resolved?

  • #6 / Dec 01, 2008 5:02pm

    knite

    20 posts

    This is certainly one way of doing it. As always, there are multiple approaches. Would you want me to move this over to Howto for further discussion, or do you consider the issue resolved?

    Resolved but vaguely disgruntled. 😊

  • #7 / Dec 01, 2008 5:04pm

    Ingmar

    29245 posts

    Sorry to hear it. Going to close this thread regardless, please come back and start a new thread any time you need our help.

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

ExpressionEngine News!

#eecms, #events, #releases