Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

How to make top menu sections without content and jump to the first child?


Go to End
Reply

10 Posts   3619 Views

Avatar
cliersch

2 September 2008 at 6:03am (Last edited: 2 September 2008 6:07am), Community Member, 75 Posts

I would like to have a navigation menu with two level. But there is no content on the top level pages, they are only sections for the structure. I would like to jump from the first level directly in each section to the first child item. How is it possible to realize it?

Avatar
cliersch

2 September 2008 at 8:57pm (Last edited: 2 September 2008 8:59pm), Community Member, 75 Posts

I try to explain my problem again, please someone my help me.
I need to build a menu with this structure

Home

Products
-Product 1
-Product 2

Projects
-Project 1
-Project 2

Contact

The Products an Projects items have no content. I would like to reach directly the Product 1 page when I klick on the Projects section.
Is there any possibility to build this model?

Avatar
grilldan

2 September 2008 at 9:19pm Community Member, 135 Posts

You could try making the Products and Project pages "Redirect Pages".

Avatar
cliersch

2 September 2008 at 9:41pm (Last edited: 2 September 2008 9:42pm), Community Member, 75 Posts

Ok - good idea! But how woud you realize it concretely?

Avatar
Sean

2 September 2008 at 9:41pm Forum Moderator, 921 Posts

Redirector pages linking to the first child would be the way to do it, as grilldan said.

Avatar
Sean

2 September 2008 at 9:43pm (Last edited: 2 September 2008 9:44pm), Forum Moderator, 921 Posts

So you'd change the page type in the CMS (using the behaviour tab) for the Products and Projects pages to a "Redirector page".

Then, you'd choose the first child from the dropdown once the page is changed to a redirector. This means that if anyone hits that given page, it'll redirect them to the page chosen in the dropdown.

Avatar
SilverRay

2 September 2008 at 9:44pm (Last edited: 2 September 2008 9:45pm), Community Member, 167 Posts

Hi tiga,

Or see here:

http://doc.silverstripe.com/doku.php?id=recipes:controllers

Avatar
cliersch

2 September 2008 at 10:15pm Community Member, 75 Posts

Thanx to all of you! Great, it works!
I haven't found the easy way to use just an other page type! Thats the possibility for my project.
And it's good to know php function for an other project!
Great community! :-)

Go to Top