Domanda

I've searched for days and not found a clear answer for this. I'd say I'm intermediate with Drupal (at best). I'm using Views, Panels, CCK, and the Date modules (among others, that may not relate to this question)

I've got a content type of Shows (plays), that has a date range field (from the date module) that is the run date of the show. I've got 3 views blocks that I filter using the Content: Show Dates - start date and Content: Show Dates - end date fields. These display a list (links) to shows that are of 3 categories, now playing, upcoming, and past shows. They work fine.

Now for the tricky part (for me). I want Panels (Node rewrite for Shows) to decide which one to display in the sidebar while looking at a Content:Show based on whether it is currently running, yet to run, or in the past.

What are the steps to make this happen?

thanks! jason

Edit: I'm working with Blocks too.

È stato utile?

Soluzione

I would suggest to create 3 views (not necessary blocks if you have enabled the "Views content pane" module), one for each date option with a nid as Contextual filter and a display of Content:Node. Then add all the 3 views in one panel page variant one after another. Probably you already have these blocks. So you can clone them and just add a nid Contextual filter.

Another option is to create 3 different variants for the same node type and add a Selection Rule for the Show Date field (Selection Rules screencast). If there are no filters for the date field add some php code. Here is an example.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top