PHP Joomla! 6 Joomla! 5 Joomla! 3 (Legacy) Template Override Basic

Generate Friendly SEF URL for an Article Category

Generates the SEF URL for an article category using RouteHelper::getCategoryRoute() and Route::_().

Updated on 24 November 2026 33 copies 137 views
templates/seu_template/html/com_content/article/default.php
<?php

declare(strict_types=1);

use Joomla\CMS\Router\Route;
use Joomla\Component\Content\Site\Helper\RouteHelper;

$catUrl = Route::_(RouteHelper::getCategoryRoute((int) $item->catid, (string) ($item->language ?? '*')));
echo htmlspecialchars($catUrl, ENT_QUOTES, 'UTF-8');
Uses RouteHelper::getCategoryRoute() with multilingual routing support.
templates/seu_template/html/com_content/article/default.php
<?php echo JRoute::_(ContentHelperRoute::getCategoryRoute($item->catslug)); ?>
Legacy Joomla 3 version using JRoute and ContentHelperRoute::getCategoryRoute().

Technical explanation and best practices

Ideal for turning category badges into clickable archive links inside articles, blog cards or custom modules.

Pass both catid and language in Joomla 5 and 6 to keep multilingual URL prefixes intact.

Direct Engineering

Have a Joomla project or technical challenge in mind?

From architectural diagnosis to production deployment, directly with the engineer.