Category Menu Help!

2 posts by 1 authors in: Forums > CMS Builder
Last Post: August 30, 2010   (RSS)

By hordak - August 30, 2010

Hi I'm trying to list pages/sub pages, however according to create 2 unique sections??? is there a way to just list the category menu? I'd like to take advantage of the "Parent Category" field generated with the category menu, but i don't know how to control the submenu to create a submenu.

The desired effect:
<link>Parent Link1</link>
<a>Sublink 1</a>
<a>Sublink 2</a>
<a>Sublink 3</a>
<link>Parent Link2</link>
<a>Sublink 1</a>
<a>Sublink 2</a>
<a>Sublink 3</a>

My list page looks as such

<?php
// load records
list($as_ns_linksRecords, $as_ns_linksMetaData) = getCategories(array(
'tableName' => 'as_ns_links',
'selectedCategoryNum' => '', // defaults to getNumberFromEndOfUrl()
));
?>


<!-- Beginning of Right Navigation -->
<div class="container">
<div class="top"><span class="text">
<strong>NS Links</strong>
</span>
</div>

<div class="OneColumn">
<ul class="list">
<li><a href="index.php"><strong>NS Home</strong></a></li>
<?php
$selectedCat="";
foreach ($as_ns_linksRecords as $record){
if($record['_isSelected']){
$selectedCat=$record['num'];
break;
}
}
?>
<!-- STEP2: Display Records (Paste this where you want your records to be listed) -->
<?php foreach ($as_ns_linksRecords as $record): ?>
<?php if ($record['depth'] == 0) { continue; } ?>

<?php if($record['active']==1 && $record['hide']==0 && $record['parentNum']==$selectedCat): ?>
<li><a href="<?php echo $record['_link'] ?>"><?php echo htmlspecialchars($record['name']);?></a></li>
<?php endif ?>
<?php endforeach; ?>

<?php if (!$as_ns_linksRecords): ?>
<li>No records were found!</li>
<?php endif ?>
<!-- STEP2a: /Display Uploads -->
</ul>

</div>
</div>