Hi, I have a context/menu problematic and I can't find the solution anywhere.

I have a very high-level taxonomy vocabulary, "community", and I want most of my site to be contextualized, based on it.

I currently have a community menu (used Taxonomy Menu module for that), and a "course" menu item which I want to get contextualized by the current taxonomy. Example screenshot : https://snag.gy/eirKDg.jpg

So, on my.site/paris (a custom url for the "Paris" taxonomy term), i want my "course" menu to link to my.site/paris/liste-cours (which will be a view with a contextualized filter).

Maybe I'm wrong in the way I'm trying to achieve my goal. Basically what I want is, if someone reached a given community (ex. my.site/paris), I don't want the other communities to appear anywhere else than in the "community" menu. I don't want people to see their community content mixed in the general content, and I don't want them to keep selecting their community in every menu (because the obvious way would be a "course/paris" menu).

So basically I want a way to define contextualized menu links, something like "/%/cours", similarly to contextual filters in views.

I hope I'm clear. I've been going through contextual links views and menus and I just can't find what i'm looking for. Sorry if it's a mess, it's my first post.

Comments

parijke’s picture

I have a similar use case, using cities as the global context. I am currently investigating several options, like the group module, OG, and https://www.drupal.org/project/global_filter

Is it an option to explore things together?

nicolas.1.vives’s picture

Hello,

I went for the group module. But I failed to set contextualized menu items (I tried a lot of ways, I can enumerate them if you want), So I'm building them manually (I have very few communities currently, I can afford to do things manually). I'm on Drupal 8 by the way.
With Groups I tried some other Group Menu module, but it bugged so I stopped.

Here is a list of things other from Group that I tried (or just came across sometimes) :
- Context :
- https://www.ostraining.com/blog/drupal/context-tutorial/
- https://drupal.stackexchange.com/questions/9332/views-contextual-filters...
- contextual filters :
- https://www.drupal.org/node/1578558
- https://drupal.stackexchange.com/questions/174251/taxonomy-term-name-as-...
- Panels (didn't actually try) :
- https://www.drupal.org/node/1263652
- https://www.drupal.org/project/panels
- https://www.drupal.org/node/2457747
- Conditional fields : https://www.drupal.org/project/conditional_fields
- Menu token : https://www.drupal.org/project/menu_token
- Event dispactcher :
- https://stackoverflow.com/questions/41716747/menu-token-drupal-8-alterna...
- https://www.chapterthree.com/blog/how-to-register-event-subscriber-drupal8
- Context vocabulary : https://www.drupal.org/project/context_vocabulary
- Context field : https://www.drupal.org/project/context_field
- Custom Path : https://www.drupal.org/node/2488874

parijke’s picture

Hi Nicolas,

Thanks for the response. How is the group module performing? I guess you make a group type City, and the groups like Amsterdam, Berlin, London etc?

Then you make group roles so a group member can only add content to the group.

How do you enforce that anonymous users see content belonging to Amsterdam, Berlin etc? You must choose a city on the home page, and then a view is shown with a content listing beloning to that group?

I see by the way that the group menu module is only for D7 available yet. That sounded like a plan (that when a group is viewed, only group menu items are shown)

nicolas.1.vives’s picture

How is the group module performing? I guess you make a group type City, and the groups like Amsterdam, Berlin, London etc?

Yes, i made a "community" group type, which corresponds to a kind of city type.

How do you enforce that anonymous users see content belonging to Amsterdam, Berlin etc?

In the right management section, you can give view/edit/delete permissions to users based on profile, including anonymous users.

You must choose a city on the home page, and then a view is shown with a content listing beloning to that group?

In my case I left the welcome page neutral, and added a dropdown menu to select the chosen community. Then I added a separate contextual menu to display the community's content.

I see by the way that the group menu module is only for D7 available yet. That sounded like a plan (that when a group is viewed, only group menu items are shown)

Well it must have been disabled for D8 because I can't find it now but I've been able to download it for D8 previously. Anyways it didn't work.

mmjvb’s picture

Recent changes made to d.o causes the hiding of development releases. It requires an additional release like an alpha or beta to appear.
Obviously, the development release is still available for download in the list of releases.