Does anyone know if there is a way I can add alerts into the smarty variable please? In the clientareadomaindetails.tpl file, we have the below:
{if $alerts}
{foreach $alerts as $alert}
{include file="$template/includes/alert.tpl" type=$alert.type msg="<strong>{$alert.title}</strong><br>{$alert.description}" textcenter=true}
{/foreach}
{/if}
I would like to add to these alerts to display my own custom messages. Using the below I have managed to create my own custom alerts within my registrar module
function modulename_ClientArea($params) {
global $smarty;
$alerts = array();
$alerts[] = array(
'title' => 'Title',
'description' => 'description',
'type' => 'info'
);
$smarty->assign('customalerts', $alerts);
return '';
}
But this would involve maintaining the tpl file mentioned above, which I'd like to avoid. I have tried the below as well, but anything I add doesn't exist by the time it gets the tpl file gets loaded, even when there are alerts already in the array when I add to them.
function modulename_ClientArea($params) {
global $smarty;
$alerts = $smarty->getTemplateVars('alerts');
$alerts[] = array(
'title' => 'Title',
'description' => 'description',
'type' => 'info'
);
$smarty->assign('alerts', $alerts);
return '';
}
FYI the reason I am not simply returning the alerts as html instead is because they would be put at the bottom of the domain overview page.