I have the following code block in a Smarty .tpl file used in my WHMCS template.
{foreach from=$departments key=num item=department}
<a class="list-group-item" href="{$smarty.server.PHP_SELF}?step=2&deptid={$department.id}">
<i class="fas fa-envelope"></i>
<strong>{$department.name}</strong>
{if $department.description}
<p>{$department.description}</p>
{/if}
</a>
{foreachelse}
<span class="list-group-item">{include file="$template/includes/alert.tpl" type="info" msg=$LANG.nosupportdepartments textcenter=true}</span>
{/foreach}
If I try to add a new href below the closing {foreachelse} it doesn't display the new link on the page, but if I put it before the opening {foreach then it displays correctly.
I've never worked with Smarty before. Is this a common issue, and if so, is there a solution to it?