Multiple Category Menus

4 posts by 2 authors in: Forums > CMS Builder
Last Post: November 12, 2010   (RSS)

Just wondering if anyone has done anything using multiple Category Menu Sections and brought them all together to display on one navigation menu.

The site I am currently building is going to have several people maintaining the content. When they log into CMSB they will only have access to their specific section. It would be nice if they could add additional pages via the Category Menu but only in the area of the site they have access rights to. With everything under one Category Menu Section, they would have access to everything unless I not aware of a way to control this access.

Thanks in advance...

Re: [chris] Multiple Category Menus

Chris,

This makes sense and I'll give it a try.

What would you suggest for the code to load the records for each section at the top of the page? Obviously I'll need to reference each table for the different sections in tableName. What would be the best way to do that?

<?php

require_once "cmsAdmin/lib/viewer_functions.php";

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

?>


Many thanks...

Re: [pcolvin] Multiple Category Menus

By Chris - November 12, 2010

Hi pcolvin,

I'd simply copy-and-paste the getCategories code, changing the names of your variables and tables:

list($salesCategoryRecords, $selectedSalesCategory) = getCategories(array(
'tableName' => 'sales_category',
));
list($supportCategoryRecords, $selectedSupportCategory) = getCategories(array(
'tableName' => 'support_category',
));


If you need to use "selected categories", things become a little more complicated because you can't simply use getNumberFromEndOfUrl (since the number might refer to a sales or a support category!)

Please let me know if you have any questions.
All the best,
Chris