News returnid depending on category
Posted: Mon Apr 29, 2013 10:54 am
Since we upgraded one of our sites from 1.11.4 to 1.11.6 we have a news returnid-problem.
In order to show a news item from a summary including several categories on its own specific page we have put in this code of 'Peciura':
This always worked fine but now it throws in an an 'Not Found' error if the category starts with numbers (like in 'News,cntnt01,detail,0&cntnt01articleid=734&cntnt01returnid=12-13-a1') or it goes to the home page instead of the page_alias (as in 'News,cntnt01,detail,0&cntnt01articleid=610&cntnt01returnid=nieuws').
What can we do to resolve this?
Or maybe there is a better way in reaching our goal... we only want a news article to show up on its own page (depending on its category) when listed on the home page (or any other page) with multiple categories (like in '{news category="sports*"}'). F.i. an 'category=soccer' news article must show on the 'soccer' page as an 'category=baseball' news article must show on the 'baseball' page.
Thanks in advance.
Kind regards,
Ron Hoenson
(We have dozens of categories so renaming all categories and our page_aliases is not something we would be looking forward to do if there is another way...)
In order to show a news item from a summary including several categories on its own specific page we have put in this code of 'Peciura':
Code: Select all
{capture assign='category_page'}{$entry->category|replace:' ':'-'|lower}{/capture}
{$entry->titlelink|regex_replace:'/returnid=[^&]*/':"returnid=$category_page"}
What can we do to resolve this?
Or maybe there is a better way in reaching our goal... we only want a news article to show up on its own page (depending on its category) when listed on the home page (or any other page) with multiple categories (like in '{news category="sports*"}'). F.i. an 'category=soccer' news article must show on the 'soccer' page as an 'category=baseball' news article must show on the 'baseball' page.
Thanks in advance.
Kind regards,
Ron Hoenson
(We have dozens of categories so renaming all categories and our page_aliases is not something we would be looking forward to do if there is another way...)