I wasn't sure whether to classify this as a feature request or a support request. Part of me has a hard time imagining that this functionality isn't already supported with OG Menu but I cannot for the life of me figure out how to make it work.
On my site I am using og_menu and I've set it up so each group has some default links that point to some views displayed in panes. For example one view grabs all the nodes of type (image gallery) for the supplied group ID. I've then created a custom panel display with the address group/images/!nid
On the OG_MENU side of things I have a default link for my group set up as follows:
Gallery|[site:url]group/images/[node:nid] (pointing to the address specified in my panel display above)
The default link works. When clicked it loads the appropriate panel display and enclosed view which in turn displays the correct image galleries for the group in question. There is one problem however. I cannot get the og menu (which displays fine on the group home page and when viewing a specific image gallery) to display on the view page itself. For usability I need to have the menu displayed here so my users don't get lost when they load the list of galleries for the group.
I tried creating a context out of the nid passed into the panel display but nothing I do seems to work. The og menu block has no way to sense the context I supplied. I doubt I'm the first person who has tried to do this. Any advice you can provide would be invaluable. I've run out of ideas.
I'm using version: 7.x-3.0-rc5+5-dev
Admittedly this may be a lack of understanding on my part. I do not understand how og_menu identifies the context to use to load the appropriate menu. My hope was that creating a context on the panel display based on the nid for the parent group would be sufficient. I am extremely lost and unsure how to proceed.
Thanks,
Jay
Comments
Comment #1
rv0 commentedThe problem is not og_menu
og_menu just takes whatever context og_context returns.
Afaik there is nothing available that automagically sets the group context from a view. It doesn't seem easy to make a generic solution for this, and it is completely outside the scope of og_menu
You are right that you are not the only person with this issue. It has been posted here before, have a look at the other (closed) issue for some pointers on how to do this with custom code #1700626: OG Menu block disappearing on Views Page displays
Have a look at the second link, I posted some code snippets there.
Comment #2
jaydarnellThanks rv0 and I sincerely apologize again for muddying your other discussion yesterday.
I ended up setting my og_context in a php snippet I added to the footer of my view. I'll comment with the details on the linked thread.
- J