Setup navigation

6 posts by 4 authors in: Forums > CMS Builder
Last Post: August 26, 2012   (RSS)

Re: [samsam92] Setup navigation

By Chris - March 30, 2010

Hi samsam92,

I think the simplest way to accomplish this (and the approach I would take) is to decide which parts of your navigation menu can be static. For example, you could drive the menu you posted above with three sections: About Pages, Projects, and Services. Your menu could be:

<ul>
<li><a href="/">Home</a></li>
<li><a href="/about.php">About</a>
<ul>
<?php foreach ($about_pagesRecords as $record): ?>
<li><a href="<?php echo $record['_link'] ?>"><?php echo htmlspecialchars($record['title']) ?></a></li>
<?php endforeach ?>
</ul>
</li>
<li><a href="/projects.php">Projects</a>
<ul>
<?php foreach ($projectsRecords as $record): ?>
<li><a href="<?php echo $record['_link'] ?>"><?php echo htmlspecialchars($record['title']) ?></a></li>
<?php endforeach ?>
</ul>
</li>
<li><a href="/news.php">News</a>
<li><a href="/services.php">Services</a>
<ul>
<?php foreach ($servicesRecords as $record): ?>
<li><a href="<?php echo $record['_link'] ?>"><?php echo htmlspecialchars($record['title']) ?></a></li>
<?php endforeach ?>
</ul>
</li>
</ul>


If you don't like that approach, an alternate solution would be to use a Category Menu, where each record has both "title" and "url" fields. That's a little more complicated because you'll need to figure out the URL to the new page you've created and remember to add an entry in your navigation section for it.

I hope this helps. Please let me know if you have any questions.
All the best,
Chris

Re: [chris] Setup navigation

By samsam92 - March 30, 2010

Thanks Chris for your answer.

I actually created a new section called top navigation in which I've added the Navigation Titles / URLs and display those elements in the page in a separate viewer.

I hope in the future releases that there will be some kind of easy navigation management.

Take care

Re: [Chris] Setup navigation 4 tier category menu

By Mikey - April 29, 2012 - edited: April 29, 2012

Chris,
I've been racking my brains on something a bit more complicated than this original thread for hours upon hours now...
I'm trying to build a 4 tier category driven horizontal mega menu, similar to what you can see here.
http://nettuts.s3.amazonaws.com/819_megamenu/demo/index.html Only mine will have multi-level subcategories listed below the parent category. I need to menu to active upon roll over, not once clicked. And I just cant figur out the code need to get the records from CMS Builder to make this happen.

Can you explain the cms builder code needed to achieve categories as parent, child, grand child and great grandchild:

o Home

o About
> Tier One page
> Tier One page

o Projects
> Tier One page
> Tier One page
>> Tier Two page
>>> Tier Three page
>>>> Tier Four page
> Tier One page

o News

o Services
> Tier One page
> Tier One page
>> Tier Two page
>>> Tier Three page
>>>> Tier Four page
> Tier One page
>> Tier Two page
>>> Tier Three page
> Tier One page
> Tier One page

http://www.interactivetools.com/iforum/Products_C2/CMS_Builder_F35/gforum.cgi?post=89145;t=search_engine
http://www.interactivetools.com/forum/gforum.cgi?post=64259#64259

I've read these pages till I'm blue in the face and browsed the forum over and over again... and I'm just not getting it. Any help would be greatly appreciated.

Re: [zick] Setup navigation 4 tier category menu

By Mikey - August 25, 2012

One have any suggestions to build a 3 or 4 tier category menu powered navigation? I've tried everything I can think of, search the forum and tried countless solutions and simple can't get a navigation built that could goe 3 or 4 levels deep - powered by category menus.

Such as:

o Services
> Tier One page
> Tier One page
>> Tier Two page
>>> Tier Three page
>>>> Tier Four page
> Tier One page
>> Tier Two page
>>> Tier Three page
> Tier One page
> Tier One page

Thanks Zick

Re: [zick] Setup navigation 4 tier category menu

By Jason - August 26, 2012

Hi Zick,

The first thing to do is to find a drop down menu script. I've found that the best ones are the ones that are based on a simple nested <ul> structure. I've used this script successfully a number of time:

http://www.dynamicdrive.com/dynamicindex1/ddsmoothmenu.htm#

As far as what you need to do with CMS Builder, set up your category menu. Then retrieve the records using getCategories().

Finally, you can out put your nested category structure like this:

<ul>

<?php foreach ($categoryRecords as $category): ?>

<?php echo $category['_listItemStart'];?>

<a href = "<?php echo $category['_link'];?>"><?php echo $category['name'];?></a>

<?php echo $category['_listItemEnd'];?>

<?php endforeach ?>

</ul>


Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

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