Selection rules for panes are nice but limited. Imagine what would happen if Panels exposed its panes to the Rules module!

Basic functionality I can think of:

Events:
-- A Panel is being viewed (all variants) (provides: Panel, all Panel's Variants)
-- A Variant is being viewed (provides: Variants, all Variant's Panes)

Conditions:
-- A Pane has content (params: Pane)

Actions:
-- Exclude a Pane from display (params: Pane)
-- Include a Pane in display (params: Pane) (*)

* To include a Pane in the display via Rules, Panels must first enable to "exclude from display" as a default in its UI. I suggest that having a "visible"/"invisible" initial mode, and adding the above items to Rules integration, could completely replace the "Visibility Rules" mechanism with a stronger, more flexible engine.

How about?

Comments

Letharion’s picture

Assigned: Unassigned » merlinofchaos

Merlin, what do you think? It sounds useful, and I could look at writing the rules integration.

@valante Don't expect it to happen anytime soon though :)

valante’s picture

Just a thought for a brighter future :-)

Thanks for considering!

matglas86’s picture

How about the other way round? Not rules changing the panel but variants reacting on rules. I was looking for something like that today.

I hoped that I could make a variant respond to a context condition that is setup by the Context module. Something like if this page meets the condition of this context use this variant. But that could also be done by having a rule from the Rules module meet a condition and set trigger a variant.

simon_s’s picture

Rules / Panels integration (in both ways) would be so ultra powerful...

kopeboy’s picture

Priority: Normal » Major
Issue summary: View changes

Any updates?!

I would like to be able to place a pane in a panel with Rules.

This is very common scenario and I was surprised there is still nothing good to do this.

Example: I have a newspaper issue which contains articles. The editors can add and rearrange the articles in the issue with Panels IPE (in-place editor).
The problem is that the articles are not there individually. And placing them one by one is both consuming and not user friendly (they have to select title or nid among all the site's nodes..).

You could just say that any (entity) referenced article is placed as an existing node in the issue panel when it's created..

I am able to sponsor this development..

wizonesolutions’s picture

I'm looking for something like this too. Ideally, I would be able to use a Rules condition set component and then have that be the basis for variant selection. I can see that the challenge would probably be properly passing data to the condition set...but I think I might try to do something like this and simply have it only pass the user context...either that or come up with some pattern for the arguments the condition set accepts and pass all of the Panels contexts in order.

....oh. Rules Bonus Pack seems to do this. I might submit that part as a separate module if I wind up having to fix it.

delacosta456’s picture

hi wizonesolutions

Please can you explain/describe more about Rules Bonus Pack ?

Thanks

wizonesolutions’s picture

@delacosta456

https://www.drupal.org/project/rb

Other

* All Rules condition components are exposed as CTools access plugins, for
example making them accessible in Page manager and Panels.