I was told JRoute was going to be phased out and no longer work on future versions of Joomla. The following code work(ed) well and gave me the output url I wanted:
So after some trial and error I tried getting the same result with the new way of doing it, see below:
I just wanted to know if this is the proper way of doing it. The result is what I want, but it might be it's still not done in a best-practice way. Any feedback would be most appreciated.
(to frame it in the right context, I want to add an url in my override template for Article, and have it take the user to the category of said id)
Code:
JRoute::_('index.php?option=com_content&view=category&id=9')
Code:
Route::_(RouteHelper::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language) . "&view=category&id=9");
(to frame it in the right context, I want to add an url in my override template for Article, and have it take the user to the category of said id)
Statistics: Posted by SocketPup — Sat May 04, 2024 6:04 am