I'm working on a new site that wants their main website divided into sections. So, that the home page is the corporate site and on the corporate home page, you get the option of splitting off into two smaller sites. This smaller sites are just smaller sections that each have their own independent content and primary navigation. They don't want to do a multi site, they want everything to be going to the same url.
This leaves me with some architecture questions. I know I can make multiple custom menus but, can I have more than one primary navigation on one site? So what I mean is, what if on each section I want the primary navigation in the same part of the page, but each primary navigation bar has different links?
We're building this site using Zen's Starter Kit and they have a #navigation id that I would like to utilize on each section instead of using a custom blocks if possible.
Can anyone help with this? Maybe I'm making it too complicated.
Thanks for any help.
Becky
Comments
What about using a preprocess function?
It seems like you should be able to use a preprocess function to alter the $primary_links variable to anything you like.
There is only one menu in the menu system called Primary Links so I would organize the menu items for each "section" in it's own menu. Then in the preprocess function, when the variables for the page can be altered, I would load the menu I needed based on the section and put it in the primary_links variable. This way your page.tpl.php template file only has to reference a single variable ($primary_links) but you control the menu items that are in it and it's always in your #navigation element.
Edit:
Here is some documentation on preprocess functions --> http://drupal.org/node/223430
Thanks for the tip. I'm
Thanks for the tip. I'm going to look in to this a lot. If i get it worked out, I think it will be more elegant than having different blocks for every "primary" menu. However, my php skills are rather weak so it might take me a while to figure it out. Time is kind of of the essence though.... Thanks for the link to the handbook.
Would you recommend using the sections module?
Becky
I have never used the sections module.
So I am not able to comment on it. Once you have decided how you are going to architect your "sections" it will be easier to figure out the code to use in the preprocessor function.
Update
My Boss changed his mind about the primary links menu. So now the primary links are the same across the sites, they just have different submenus which is ok. The primary links are links back to the front pages of the main sites and the client login area. Thanks for the information though. I'll keep it in mind if this situation comes up again for me.
Becky
This may work for me...
My site also has sections. I have a Primary Links Menu that has the usual Home, About Us... I also have a menu I create to Navigate the Shop section of my site. My problem is I am using Four Season Theme and I like the look of the primary Links menu, but I want to make the Shop menu that will be in place of the primary links menu on the shop pages. Can you help me? See my latest post http://drupal.org/node/854338#comment-3202554. Any help would be greatly appreciated.
Thanks :)
How about using the menu blocks?
Doesn't each menu create a corresponding block? Couldn't you just create a new menu for each set of primary links, place all the blocks in the same place, and use the block visibility settings to make sure the correct one shows up in the correct sections.
Yeah, you're right. at the
Yeah, you're right. at the time that I wrote this though, I had no idea what i was doing. Haha.
I can create other
I can create other menus...like you suggested but my problem is getting those menus I created to look like the Primary Links menu that comes with the theme. If I change the menu settings to make the menu I created be the source for my primary links then it looks the way I want it but I can only set one menu as the primary link source. Is there a way to make the menu that is available in the block have the same styling "look" as the Primary menu the theme provides?