I'm grateful for the amazing organic groups module (and so many other drupal modules), which I am using for a civil society and social economy network platform.
I have a question, which I think would be interesting for others too. I couldn't find the answer anywhere.
Usecase: I have a page (in page manager) which outputs a tab in og_group nodes, showing a view panel pane of og_group content (together with other panes). Specifically, og_group are organizations, and og_group contents are events. So I'm showing events of each organization in a separete tab.
I wish this tab "events" to be visibile only if there is at least one node of type "event" listed as group content of the og_group page being viewed.
In order to do this, I am trying to use page manager "access rules", which, to quote specific documentation:
are used to test if the page is accessible and any menu items associated with it are visible.
The "only" og related rules available are:
"Node is an OG group" "Node is an OG group content" "user membership in group" "user permissions in group"
So, I think my logic is possible with the generic "php code" rule. But I'm no coder, yet.
Anybody could give me a hint about what code should I write to check if te viewed node (which is an OG group) has at least one event associated with it as group content?
Config: D7 7.41, php 5.2.4, panopoly 7.x-1.28, og 7.x-2.7, ctools 7.x-1.8, panels 7.x-3.5
Update: as @Stefanos suggested in his answer, I am searching for a kind of "no results" behavior of views module, in page manager.