Hi all,

Using
- Drupal 7.6
- Menu Block 7.x-2.x-dev
- Menu Position 7.x-1.0-beta4
- Display Suite 7.x-1.3

If you set up a Menu Block and then set up a Menu Position rule to set the active menu trail to show your menu block if the current node is within the active trail, this works fine without Display Suite.

For example, you can create an Article Node type, make an article node ("my test article"), and make a rule to place it in the menu like so...

Parent 1
- Child 1
Parent 2
- Child 2
- My test article

Then if you place the menu block in say the left region with the settings in the screenshot attached it will show up as expected. Works fine if you assign it to the left region using the Context module too.

HOWEVER, if you turn on Display Suite the left region/menu block is turned off and doesn't appear. It's almost like Display Suite renders the page before Menu Block/Menu Position gets a chance to check the active trail and decide if the block should be shown or not in the region. Is this a module weighting issue?

I tried creating a block field with the menu block inside it within Display Suite. Then assigning the block field to a region in Display Suite, but that didn't work either.

Thanks for reading,
-Tim

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

swentel’s picture

Status: Active » Closed (cannot reproduce)
FileSize
29.96 KB

Works fine here - see screenshot. DS in now way interacts with block system rendering or the like.

You didn't toggle the 'hide regions' on the layout settings by accident ?

TimG1’s picture

Hi Swentel,

Thanks for taking a look. I just tried this again on a blank install this time and it's working. O_o

Here is a better example of the menu structure of my site.

ABOUT
- Overview
RESEARCH
- News
-- News Article Title (this is where I'm trying to make the active trail with menu position)
CONTACT

I'm using Menu Position to position the article inside the news section since I don't want a long list of news articles in the menu.

I'm not sure what is causing this on the development server I'm working on. I've tried disabling various modules and disabling Display Suite will make things work as expected. The development site is on a windows server. Is there any reason that would make a difference?

Feel free to close unless you're able to replicate. I'll reopen this issue if I can reproduce consistently on another blank install.

Thanks again,
-Tim

Jānis Bebrītis’s picture

I have the same scenario, same combination of modules and the same issue. I had time to dig deeper trough DS/block field, Menu Block and ended up in Menu Position.

Apparently menu position rules get initialized only after the menu blocks for DS have been generated already. They are launched using hook_page_delivery_callback_alter, the menu_position_page_delivery_callback_alter();

My solution was putting the initialization function in good old hook_init of my custom module and it works. Wondering what breaks though. Probably this helps someone to move forward.

function custom_actions_init() {
  menu_position_page_delivery_callback_alter();
}
willito’s picture

Old thread, but I just ran into this issue.

I'm using:

Display Suite
Menu Blocks (via Display Suite Block Field)
Menu Position Rules

I have this menu structure:
about
- news (view)
--menu position rule

Menu would not display even though active trail was set properly (my site's navbar only displays the first level).

#13 fixed this issue for me.

jrochate’s picture

Hi.

the #3 also fixed it for me.

Same modules, different versions, but the same problem. With this line, I can see active path and use Menu Block "selected by the page" with success when using Menu Position.

thanks.