display category menu in <ul> format

21 posts by 6 authors in: Forums > CMS Builder
Last Post: August 9, 2010   (RSS)

By Jason - August 9, 2010

Hi April,

The first thing I noticed is that you have a CSS class for an item that's a parent, and for an item that's a parent with children, but you don't have a CSS class for children elements.

Splitting the list into two columns shouldn't be too difficult. You'll need a second div that will display beside your first div (textbox1). For example, we could call this div textbox2.

All you need to do is to figure out where the halfway point is in your record list and maintain a count of how many records you've outputted.

For example, it could look something like this (Note, this code is untested):



<?php $halfRecords = mysql_select_count_from("sitemaplist")/2;?>
<?php $count=0;?>

<?php foreach ($sitemaplistRecords as $record): ?>

<?php if($count==$halfRecords): ?>
</div>
<div id="textbox2">
<?php endif ?>
<?php $count++;?>

<?php echo $record['_listItemStart'] ?>
<?php $aClass = ""; ?>
<ul>
<?php if (!$record['_hasParent']) { $aClass .= "parent "; } ?>
<li><?php if ($record['_hasChild']) { $aClass .= "withChildren "; } ?></li>
</ul>


<span class="body3"><a class="<?php echo $aClass ?>" href="<?php echo $record['url'] ?>"><?php echo $record['name'] ?></a></span>

<?php echo $record['_listItemEnd'] ?>
<?php endforeach; ?>


Hope this points you in the right direction.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/