PHP
Joomla! 6
Joomla! 5
Joomla! 3 (Legacy)
Template Override
Basic
Render a Reusable JLayout with LayoutHelper::render()
Shares UI partials (cards, badges, headers) across modules and overrides using LayoutHelper::render().
templates/seu_template/html/com_content/category/blog_item.php
<?php
declare(strict_types=1);
use Joomla\CMS\Layout\LayoutHelper;
echo LayoutHelper::render('custom.card', [
'title' => $this->item->title,
'summary' => $this->item->introtext,
'url' => $link,
]);
Inside the layout file, read passed arguments from $displayData.
templates/seu_template/html/com_content/category/blog_item.php
<?php
echo JLayoutHelper::render('custom.card', array(
'title' => $this->item->title,
'url' => $link,
));
Legacy Joomla 3 version using JLayoutHelper::render().
Technical explanation and best practices
Store reusable template partials under templates/<template>/html/layouts/custom/card.php and invoke them from any module or override with LayoutHelper::render('custom.card', [...]).