By podsnap on
Is it possible to have a different sub menu per section?
So you'd have the main navigation across the top of each page and then when you click on one of those, the page that appears would have a sub menu unique to that section on the left.
When you click on another of the main sections at the top you get a different sub menu on the left.
For example you might have main navigation of:
Home - Products - Support - About Us
When you click on Products you'd then have that same navigation at the top, but on the left you'd get a list of product categories which you could then click on to get content.
Is this possible?
Thanks.
Comments
Yes. It is. You have to
Yes. It is. You have to create a menu for each one. Your top navigation is your "primary links" and each sidebar is a menu. Create a menu with items for each one, and enable them in admin->block. Configure each one to only be visible on the pages you want (ie the products menu will only show up on pages products, products/* where the * is a wild card meaning anything else can go there. Then you have to check the box on the left, and select where it will be going, and voila! You're done
Mike
Thanks
Thanks for such a swift and clear response Mike. That's absolutely fantastic.
The more I use Drupal the more impressed I am with it.
Ben
Too repeatitive
Someone should make a module to do that, this way when you create the content and decide where to place it in the main Nav, the module would see all sub items in the main Nav and make a menu for just for those sub items. This new item per page thing is rediculous! Though unfortunately I don't have the drupal api know-how nor the time to cook one up myself.
Richard Zak
Professional Genius
Geniu profesionist
AIM: rjzak
Thanks
I'd like to thank you as well... I'm also new to Drupal but am becoming ever more joyful about what I can make it do once I get through this learning curve. Thanks for your clear and simple answer.... big help to what I'm trying to do as well.
Jeffrey
An Easier Way to all this
You guys wanna check out this link, he's talking something different below though , but starts off solving this issue
http://www.coalmarch.com/coalmarch-blog/20090428263/quick-andamp-easy-co...
Absolutely
The most straightfrward way of doing this is to go to
Admin -> Menus and click Add Menu, Name the title of the menu
Add items to that menu at Admin->menus scroll down to your new menu and click "add item"
Go to Admin->Blockas and click "Configure" Next to your new menu item. You'll see a few options. You want "Page Specific Visibility Settings"
Select the radio button that says "Show Menu only on specific pages"
Enter the pages you want this menu to be shown on.
Rinse and Repeat for all your primary links.
Good Luck!
Sam Tresler
http://www.treslerdesigns.com
That's great
Thanks Sam, a beautifully laid out post, nice and easy to follow.
Cheers,
Ben
Node rename
Sorry to be thick, but Mike, you said you could list pages like products/* which I understand, but all my pages are node/6 node/11 etc... how do I create different node types? (Should I post this as a new topic?)
Nodes are...
All content types are nodes in drupal. So blogs, forums topics, stories, pages, products, etc will all sequentially increase your node #
So if you have a blog that is node/1 and a story that is node/2, there is no real differenc ein how drupal sees the data.
You can
A) create URL aliases to give a pseudo-directory structure to your content. Mapping node/1 to blog/whatever and node/2 to story/whatever,
This can be done at creation time or through admin url aliases - but you must have the path module turned on.
One might suggest that you alias all content under a certain tab with that tab's path first. example.com/prim_link_1/whatever
that way by entering the following into "SHow only on the speciied pages:
prim_links_1/*
you can get it on all menus under prim_link_1
don't forget to use this if you want the menu on pim_link_1 as well (the /* only deals with everything below prim_link_1
prim_link_1
primlink_1/*
---covers the first page too - which in your scenario you probably want.
For advanced settings and usage its worth reading through this - it will tell you how to do things based on php code (the third option in the "page visibility settings":
http://drupal.org/node/60317
It will let you skip the URL alias grunt work. Be careful, as php code can break your site if you aren't careful
Sam Tresler
http://www.treslerdesigns.com
Wonderful
Thanks Sam, really helpful.
Cheers,
Ben
Erm....
Sorry Sam,
But while I understand the principal of what you are suggesting (I'm trying to go for 'alias all content under a certain tab's path') I can't work out exactly what I have to do to accomplish this.
Can you help?
Thanks
Got it?
I think I have it.
You give say a the products homepage a alias (under 'url aliases') an alias of 'products'.
Then if you create pages within the products section you put in (at time of creation, in the 'url path settings') something like 'products/chairs'
Then in the configuration of your menu under 'blocks' (in 'administer') you type:
products
products/*
That way whenever you create a new page which has the url path settings of 'products/something' it will automiatically show the menu.
Nice.
Right. That works. Take a
Right. That works. Take a look at my site (it's still in development) so you can see this at work. Not all of the pages are up, and some still have placeholder text, but you'll get a good idea of how it works. Creating a hierarchy in your site is very useful in organizing things.
http://72.32.121.191
Mike
You can also use books to
You can also use books to accomplish this. You won't have to create a menu for each one, it's only the one book block where you show the book hierarchy. It's not the most efficient, but it works as well.
Mike
There's More than One Way to Skin a Cat
There are a couple of different ways that you can get a path alias for all of your content.
1) The easiest way, but not the most time efficient, is to enable the url alias module, grant the proper permissions admin->access. Then go through each node and set an alias for it.
2) Once you have the module installed, you can go to admin->url aliases, and you can type in the node names and path aliases you want.
3) Install the PathAuto module and use that to create all of your aliases for you.
You don't necessarily need to create path aliases though for what you're trying to do. If you have a list of nodes that you want a certain menu to show up in, you can just add those pages to the list of pages for the menu to be displayed in. Go to admin->block, find the block for the menu you created, click configure, and under Page specific visibility settings, type in your list of nodes:
etc.
Just make sure that you only put one per line. This might not work so well if you're going to be constantly changing the pages, or if you're going to have a lot of them. Drupal can handle it, but it will just be a pain to keep updating the blocks.
Mike
Thanks but...
Thanks Mike, very helpful.
One thing, looking at your site (very nice, by the way) your aliases show up as 'ip/youthdevelopment' but mine are showing up with a '?q=' before the alias so for example: 'localhost/?q=whatwedo'
Why is mine different?
Any ideas?
Thanks.
Clean URLs
You need to enable clean URLs. Go to admin->settings and under general settings there will be a link to run the clean url test. Click on it. It SHOULD take you back to your home page, or back to the same page. I don't remember which. I'll get to what happens if you don't later. Once you get back to your home page, go back to admin->settings and the link should have changed to a set of radio buttons where urls can be enabled or disabled. Check "enabled" and save. And that should do it.
If you don't see the radio buttons afterwards, or you get some kind of error message, you need to go into your apache settings (httpd.conf) and enable mod_rewrite.c. For a local install, I use EasyPHP, so your location of this file may vary from mine, if you are running a vanilla installation of apache. Anyway, there are two places where you will need to uncomment (remove the # at the beginning of the line) the mod_rewrite module. One should say something like:
Change that to
Then below that you'll see:
Change that to
Then restart Apache, run the test again, and viola!
Hope this helps.
Mike
No AddModule mod_rewrite.c
I found the LoadModule line but there was no AddModule line. Just uncommenting the LoadModule didn't work and adding the AddModule stopped the server from started (thought it was worth a try though).
However, if the ?q= is just a sympton of the site currently being on my local apache install and it will disapear once hosted online, then I'm not overly worried.
I will try and find a solution anyway.
It won't be directly below
It won't be directly below it. It will be in the next section. There should be a whole bunch of AddModule lines. It's in there. I promise.
Mike
Understood
Yeah, I did realise it wouldn't be directly underneath. But having searched through using Find and looked through manually, there is definately no AddModule lines of any kind in my httpd.conf :(
No AddModule
Apparently AddModule no longer exists in Apache 2 (it doesn't need it).
Unfortuantely, this doesn't help solve the problem.
I might just leave it and hope it works cleanly when I upload it to a server.
Apache2
I was scratching my head on that one. OK, now it's clear. I don't use Apache2 for local installs. See below:
http://drupal.org/node/14322
That should help you. Otherwise, do a search for mod_rewrite and Apache2 on this site.
Mike
A little more to this:
Admin has to add and edit the content as a menu in that page only. For example in products page,
admin has to add content like a menu and edit the content in that page only.That page should be appear only in products page only.
Thanks in advance.