Newbie question about Menus vs Linking to Pages structure on a Services Website

4 posts by 3 authors in: Forums > CMS Builder
Last Post: December 15, 2010   (RSS)

Re: [jkoveos] Newbie question about Menus vs Linking to Pages structure on a Services Website

By Jason - December 14, 2010

Hi,

Your right, the second category menu can probably be removed. If it's just a list of services, the easiest way to get it would be to just output the names of the services that you've stored in the Services section.

Does this help?
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

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

Re: [Jason] Newbie question about Menus vs Linking to Pages structure on a Services Website

By (Deleted User) - December 14, 2010

Hi Jason,

I guess where I'm a little lost is on how to have the side menu populate from the drop down (ie: on the services page, I want the side menu to be identical to the drop down that appears when you hover over service, without the parent category - in this case "Services" displaying.

Also not sure how to only pull the services, without also pulling the info from fleet, and any other drop downs. For example, if I have the following...

Home
Services
Wedding
Prom
Night Out
Ect...
Fleet
Sedan
SUV
Limo
Etc...


...How do I only pull up "Wedding Prom, Night Out, Ect..." on that side menu?

I am using this code currently in the footer, but in order for it to work the way I want, I had to create a separate section for each, which, ideally, I'd prefer not to have to do:


<div>
<?php foreach ($footer_quickRecords as $record): ?>
<?php if($record['depth'] == 0) : ?>

<?php echo $record['name'] ?><br/>
<ul>
<?php else : ?>
<li><a href="<?php echo $record['url'] ?>"><?php echo $record['name'] ?></a></li>
<?php endif; ?>
<?php if(($record['_isLastChild']) && ($record['depth'] == 1)) : ?>
</ul>

<?php endif; ?>
<?php endforeach; ?>
</div>
<br clear="all" />

<?php if (!$footer_quickRecords): ?>
No records were found!<br/><br/>
<?php endif ?>


Does that make sense? Any guidance greatly appreciated.

Re: [jkoveos] Newbie question about Menus vs Linking to Pages structure on a Services Website

By Chris - December 15, 2010

Hi jkoveos,

The getCategories function has an option called 'rootCategoryNum' which you can use to get only the categories "below" a given category. You can call getCategories a second time on the same section to get a different list of categories.

To use 'rootCategoryNum' for this, you'll need to know the record number ('num') of your services record. You can discover the record number of a record by modifying it in CMS Builder and looking at your browser's address bar.

For example:

list($completeMenuRecords, $selectedCategory) = getCategories(array(
'tableName' => 'my_section_name',
));

list($servicesRecords, ) = getCategories(array(
'tableName' => 'my_section_name',
'rootCategoryNum' => 123, // services record num
));


Does that help? Please let me know if you have any questions.
All the best,
Chris