I have a row of links at the top of the page. When you click on one of those links, I want specific links to appear in the left side bar. Then, when I click on a different primary link at the top of the page, I want a different set of links to appear in the left side bar. I have tried Nice Menu and another menu module as well as various themes and nothing has worked. I also tried using Drupal's built in 'show only on xxxx page' but that doesn't work either. Any suggestions -- in very layman terms, please?

Comments

grobemo’s picture

This isn't the most elegant or scalable solution, and it might be something you've tried, this could work if you only need to do it for a relatively small number of pages:

On the Menus admin page (admin/build/menu), create an extra menu for each distinct set of links that you want. For example, if you have a 'Cars' link at the top of the page, create a menu called 'Cars' with links to 'Toyota', 'Honda', 'Ford', etc.,

Once you've created your menus, go to the Blocks admin page (admin/build/block). Each of those new menus will have a Block in the list. Put all of those Blocks in the left sidebar. (Be sure to hit save after you move them!) Then configure each using the 'Show only on the following pages'. For instance, you'll find a block called Cars. Put it in the left sidebar. Configure it to show only on the page /cars (or wherever the main 'Cars' link points).

Edit: This really wasn't a very good idea on my part. See the comments below for better ideas.

imrook’s picture

The secondary links already does what you are asking for. The next problem your going to run into is that it doesn't show 3rd level or deeper menu items. There are several solutions here: http://drupal.org/node/77099

joachim’s picture

Easy peasy solution: http://drupal.org/project/menu_block

This is dead simple to set up and does exactly what you want.

Just create a menu block to show Primary levels 2+, then put that block in your sidebar.

imrook’s picture

Thanks for the post joachim. I'm sure that module will come in handy in the future!

096754’s picture

I tried the menu block module you linked to and it works great until I try to configure it to show up only on certain pages. This is the same problem I have with the other approaches people suggested above. I am able to get the child links to show up in the left side bar, but cannot figure out how to make them appear only after a user clicks on one of the primary links at the top.

imrook’s picture

I just installed the module and it behaved as expected for the following case:
* Created menu entries in the Primary links menu 3 levels deep
* Added a Menu block and configured it to show secondary level and deeper
* Added the new menu block to the left sidebar
* Visited the homepage -- no Menu block visible in the left sidebar
* Clicked on a primary link -- Menu block with menu items visible in left sidebar

I would say this module does exactly what I expected it to. It seems that this isn't what you're looking for. Could you please explain in more detail how you would like your menus to behave?

*edit*
As a follow-up, I just went and made some changes to my menu and found that the block did not respect them. Editing the block configuration and saving without making any changes fixed the problem. It appears that some caching is going on.

grobemo’s picture

You might have the block cache enabled in admin/settings/performance.

grobemo’s picture

I just tried doing this with the menu block module, too, and got it working. Here's what I have in my primary links:

  1. node/add
    1. node/add/story
    2. node/add/page
  2. admin
    1. admin/content
    2. admin/build

Here's what I did:

  1. I enabled the menu block.
  2. I went to Administer >> Site building >> Blocks >> Add Menu Block.
  3. I created a block with the following settings:
    • Parent Item: Primary links
    • Starting Item: <root of Primary links>
    • Starting level: 2nd level (secondary)
    • User specific visibility settings: Users cannot control whether or not they see this block.

    Everything else I left as the default setting.

  4. In Administer >> Site building >> Blocks, I moved my new 'Primary links (levels 2+)' block into the sidebar and saved that configuration using the button at the bottom of the list of blocks.

Now, when I go to the home page (or, e.g., /user), I see no block. When I go to /node/add (or anything below /node/add—i.e., node/add/*), I see the links to node/add/story and node/add/page in the sidebar. When I go to /admin (or any admin/*), I see the links to admin/content and admin/build in the sidebar.

@096754: To repeat imrook's question, how does this result differ from what you want? From which pages are you trying to exclude the block?

Gaperville’s picture

YES!

The image block Mod is working for me