Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
Expandable Categories

 

 


sagentic
User


Jun 2, 2008, 6:27 PM

Post #1 of 3 (248 views)
Shortcut
Expandable Categories Can't Post

I am trying to use an Accordion Menu Script (http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu.htm)

So far, I am getting shaky results.

I have:

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

It is not showing up right.

The page I am working on is:
http://www.cleburnehighschool.com/index.php

A non-CMS Builder page where it works "out of the box" is:
http://www.cleburnehighschool.com/index2.html


Dave
Staff / Moderator


Jun 2, 2008, 9:31 PM

Post #2 of 3 (234 views)
Shortcut
Re: [sagentic] Expandable Categories [In reply to] Can't Post

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:


Code
<?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


sagentic
User


Jun 3, 2008, 9:04 AM

Post #3 of 3 (155 views)
Shortcut
Re: [Dave] Expandable Categories [In reply to] Can't Post

That did it! THANKS!

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4