Setup navigation

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

By samsam92 - March 29, 2010

Hi

We would need some help because we've been looking around the forum for answers, which we found partially but can't figure out the following problem:


- We have a website with different menu/submenus that needs to be self manageable, in our case:
o Home
o About
>> Our Staff
>> Testimonials
o Projects
>> Project 1
>> Project 2
o News
o Services
>> Page name
>> Page name 2
...

Each page has to be customized (so it has a different editor, for example our Staff page will have a multiple Record type, and each record will have Name, Title, Function, Photo, Bio... the news page on the other hand will have more basic info such as Title, Short description, Long description, and so on.

What we can’t figure out is how to set up the section editors so we can create those pages and be able to have a top navigation menu on the website that will show those menu items without integrating it manually?

We are able to create each editors with no problems, but creating a Category Menu won’t allow to have different type of pages underneath it, or creating a Menu, not sure how to have all elements within the menu listed on the frontend so it shows the top navigation...

The goal to achieve is for example if the backend user adds a new page under About Us, that the main navigation on the frontend automatically displays this new page as a subnavigation

Please help, that would be really appreciated

Thanks a lot

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: [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/