Category List needs to link to different Detail pages

2 posts by 2 authors in: Forums > CMS Builder
Last Post: February 23, 2010   (RSS)

By JeffC - February 20, 2010 - edited: February 20, 2010

Hi

My question has two parts...

1. I have created a navigation menu with sub categories, using 'Add New Editor' 'Category Menu'

The menu list is working fine.

However, I need to be able to assign different detail pages to the Top Level categories to those used on the sub category pages.

For example

Item 1 - detail1.php
Item 1a - detail2.php
Item 1b - detail2.php

Item 2 - detail1.php
Item 2a - detail2.php
Item 2b - detail2.php


The top level categories will be a general introduction to the section of the site. The subcategories will be more detailed pages.

Here is my current code on my list page. The problem here is that Top Level categories and sub categories all go to the same detail page.

<?php
require_once "cmsAdmin/lib/viewer_functions.php";

list($categoryRecords, $selectedCategory) = getCategories(array(
'tableName' => 'navigation',
'selectedCategoryNum' => '', // defaults to getNumberFromEndOfUrl()
'categoryFormat' => 'showall', // showall, onelevel, twolevel
));

?>


<ul>

<?php foreach ($categoryRecords as $categoryRecord): ?>
<?php echo $categoryRecord['_listItemStart'] ?>

<?php if ($categoryRecord['_isSelected']): ?>
<b><a href="<?php echo $categoryRecord['_link'] ?>"><?php echo $categoryRecord['name'] ?></a></b>
<?php else: ?>
<a href="<?php echo $categoryRecord['_link'] ?>"><?php echo $categoryRecord['name'] ?></a>
<?php endif; ?>

<?php echo $categoryRecord['_listItemEnd'] ?>
<?php endforeach; ?>
</ul>


<a href="mailto:?subject=<?php echo thisPageUrl() ?>">Email this Page</a>



2. The two different detail pages need to have different fields. In the CMS I would like the user to be directed to different pages depending on whether they choose to create a top level item or a sub category.
Jeff