PHP
Joomla! 6
Joomla! 5
Joomla! 3 (Legacy)
Template Override
Basic
Render a Specific Module by Type and Title via ModuleHelper
Loads and renders a single module instance by module name (e.g. mod_finder) and exact title regardless of position.
templates/seu_template/html/com_content/article/default.php
<?php
declare(strict_types=1);
use Joomla\CMS\Helper\ModuleHelper;
$module = ModuleHelper::getModule('mod_finder', 'Busca Global');
if ($module && !empty($module->id)) {
echo ModuleHelper::renderModule($module, ['style' => 'none']);
}
Check !empty($module->id) to confirm the module exists and is published.
templates/seu_template/html/com_content/article/default.php
<?php
$module = JModuleHelper::getModule('mod_finder', 'Busca Global');
if ($module && $module->id) {
echo JModuleHelper::renderModule($module, array('style' => 'none'));
}
Legacy Joomla 3 version using JModuleHelper::getModule().
Technical explanation and best practices
Unlike getModules($position), calling ModuleHelper::getModule('mod_finder', 'Global Search') lets you embed one targeted module anywhere in an override or layout.