Display Custom Menu Based on Parent Space

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
wcDogg's picture

We’re using OA to build a single site that “feels” like two. To accomplish this, we have two parent spaces each with a combination of subspaces and sections.

To feel like two separate sites, each parent space needs to have its own top navigation that remains visible no matter where the user is within that space.

Think traditional top navigation as compared to OA Breadcrumbs, Group menu, and Menu Selected By Page – all of which change depending on where the user is in a space and/or rely on the page having a menu entry.

After an exhausting exploration of how the OA menus work, I’m pretty sure what’s needed are two custom menus– one for each space.

Question is: How to get Space A to display Menu A?

I think the answer is to apply a Space context to the menus? For that I looked at:
- Adding menu blocks directly to the OA Toolbar mini-panel and adding a visibility rule on the block.
- Creating a min-panel for each menu block and adding selection and/or visibility rules on the min-panel.

Either way – and maybe neither is correct – I can’t figure out how to accomplish what we’re after.

Any suggestions greatly appreciated.

Comments

I think that the toolbar is

paean99's picture

I think that the toolbar is hardwired in the Open Atrium Radix theme (some of its settings can be found at admin/openatrium/setting). If it is the case, then here are some directions for a solution.

One possibility could be to have a different theme for each space and its subspaces. Then you could change the mini-panel menu in each of them. But it would have also to work for each sub spaces.

Organic groups theme (https://www.drupal.org/project/og_theme) could be a beginning but i never used it and i don't know if it is aware of sub groups.

Open Atrium Domains (at admin/apps/openatrium/oa_domains/details) should be of great interest, especially if we can have a different theme for each domain. But it isn't really ready for this, or so i think. Although there is some work in that direction (not directly related though) in this issue 'Make subspaces inherit domain settings' (https://www.drupal.org/node/2162997).

On that idea, Subdomain (https://www.drupal.org/project/subdomain) or Domain Access (https://www.drupal.org/project/domain) modules are to be considered. But i don't know how they will work with Open Atrium. Might be unhealthy...

Another solution would be to use a preprocess function in the template file to add a new variable which has the parent top space. It would be used in a conditional on the page.tpl of the theme, giving you the ability to choose a mini panel or another according to its value.

A good solution is to simply create a custom module.

Open Atrium

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week