I am creating Joomla 4 website powered by Zoo (CCK). In custom template I want to get the list of highligted topics in an article. The highlights are upto four. But the php code is fetching only the fisrt highlight. As well as I want to set one variable which list all the three highlights.
I have tried the below code:
<?php
// get this list of all highlights of the article
foreach ($limeLights as $limeLight) {
$highlight = '<li class="hlli">'.$limeLight['value'].'</li>';
}
// set variable for highlights element
$highlights = '<div class="hlit">'
.'<h2 class="hliz">Highlights</h2><ul class="hlul">'
.''.$highlight.''
.'</ul></div>';
?>
<?php echo $highlights; ?>
The expected html output:
<div class="hlit">
<h2 class="hliz">Highlights</h2>
<ul class="hlul">
<li class="hlli">01. This is the first item from the list</li>
<li class="hlli">02. This is the second item from the list</li>
<li class="hlli">03. This is the third item from the list</li>
</ul>
</div>
But the html output I am getting:
<div class="hlit">
<h2 class="hliz">Highlights</h2>
<ul class="hlul">
<li class="hlli">01. This is the first item from the list</li>
</ul>
</div>