Is it possible to do this? Perhaps with contexts and views? If so, could someone let me know how? Thanks in advance!

Comments

Letharion’s picture

Title: Selection Rules : Filter Variant by Published/Unpublished » Selection Rules: Filter Variant by Published/Unpublished
Category: support » feature
Status: Active » Needs review
StatusFileSize
new1.31 KB

To my surprise, this actually currently isn't possible. I quickly wrote up a patch, but note that I haven't given it any testing what so ever at this point. Please take it for a spin, and maybe we can get this in. :)

Anonymous’s picture

Category: feature » support
Status: Needs review » Active

Thank you very much! I'm going to give it a test drive right now and will let you know how it goes. Much appreciated!

merlinofchaos’s picture

Status: Active » Needs review

needs review is the correct status for a patch.

Anonymous’s picture

After testing Letharion's patch using two nodes (one published, one un-published) using two variants, here's what I got:

  • When the first variant has the selection rule set to normal and the second is set to reverse (NOT), both nodes display the second variant.
  • When the first variant has the selection rule set to reverse (NOT) and the second is set to normal, both nodes display no variant at all and instead default to the default node view without Panels.
Letharion’s picture

Category: support » feature
StatusFileSize
new1.28 KB

How about now? Now I've taken the time to give this some testing myself, and it works for me.

Please note that due to one of the changes made, if you have the selection rule active when you replace the old file with the new, you'll get some php warnings until you re-save the page and gives Ctools a chance to update the plugin definition.

Anonymous’s picture

Works perfectly with no errors... Thank you so much Letharion!

Letharion’s picture

Project: Panels » Chaos Tool Suite (ctools)
Version: 7.x-3.0 » 7.x-1.x-dev
Component: Panel pages » Page Manager

Glad to hear it. I'm moving this over to Ctools where it really belongs, to see what the maintainers over there think.

merlinofchaos’s picture

Status: Needs review » Fixed

Committed, pushed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.