Expandable Categories

3 posts by 2 authors in: Forums > CMS Builder
Last Post: June 3, 2008   (RSS)

Re: [sagentic] Expandable Categories

By Dave - June 2, 2008

Hi sagentic,

It's adding a closing </ul> after each item. We need it to add that only once after each list of items but before the next header starts. Try adding the code in red:

<?php
$lastCategory = "";
foreach ($hpmenuRecords as $hpmenuRecord):
$showHeader = false;
if ($hpmenuRecord['category'] != $lastCategory) {
$lastCategory = $hpmenuRecord['category'];
$showHeader = true;
}
?>

<?php if ($showHeader): ?>
<?php if ($lastCategory): ?></ul><?php endif; ?>
<h3 class="menuheader expandable"><?php echo $hpmenuRecord['category'] ?></h3>
<ul class="categoryitems">
<?php endif ?>

<li><a href="<?php echo $hpmenuRecord['link'] ?>"><?php echo $hpmenuRecord['title'] ?></a></li>
</ul>
<?php endforeach; ?>
</ul>


Let me know if that fixes it.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Expandable Categories

By Kenny - June 3, 2008

That did it! THANKS!