Yes, that's exactly what I was looking for, thanks! Using the code above does indeed take me to the correct article(s).You can get article's non-SEF link using Joomla\Component\Content\Site\Helper\RouteHelper::getArticleRoute(). Run in through Joomla\CMS\Router\Route::_() to get the SEF link:Code:
use Joomla\CMS\Router\Route;use Joomla\Component\Content\Site\Helper\RouteHelper;$link = Route::_(RouteHelper::getArticleRoute($article->id . ':' . $article->alias, $article->catid, $article->language));
Now, if I want to just access the category of these news articles (the item in my Main Menu with the alias "nyheter"), can I use route to access that as well?
Statistics: Posted by SocketPup — Sun Apr 28, 2024 6:57 am