Here is an updated code, you can try.
<?php if (isset($this->item->jcfields[149]) && !empty(trim($this->item->jcfields[149]->value))) : ?>
<?php $regionLink = Route::_(ContentHelperRoute::getCategoryRoute($this->item->catid)); ?>
<span class="region">
, <a href="<?php echo $regionLink; ?>"><?php echo htmlspecialchars($this->item->jcfields[149]->value, ENT_QUOTES, 'UTF-8'); ?></a>
</span>
<?php endif; ?>
<?php if (isset($this->item->jcfields[149]) && !empty(trim($this->item->jcfields[149]->value))) : ?>
<?php $regionLink = Route::_(ContentHelperRoute::getCategoryRoute($this->item->catid)); ?>
<span class="region">
, <a href="<?php echo $regionLink; ?>"><?php echo htmlspecialchars($this->item->jcfields[149]->value, ENT_QUOTES, 'UTF-8'); ?></a>
</span>
<?php endif; ?>
Statistics: Posted by mjk300 — Mon Jul 15, 2024 2:33 pm