0

I'm having some trouble harmonizing Views, Views Content Panes (ctools), and Panels with Panelizer on Drupal 7. I have a working prototype, but the problem is that I have to repeat the field output across 3 views and 4 content panes.

Consider this existing content structure:

Content node:

|-Title
|-Image
|-Body
|-Vocab A term reference
|-Vocab B term reference
|-Other fields

Taxonomies:

|-Vocab A
|-Vocab B

The views:

View 1: Front Page

|-Slide show (content pane)
| |-Title
| |-Image
| |-Body
|
|-Dynamic blocks (content pane)
| |-Title
| |-Image

View 2: Product Catalog

|-Taxonomy page (page)
| |-Title
| |-Image
| |-Body

Finally, the node display, a full-page override from Panelizer:

Content node panelizer page:

|-Title pane
|-Image pane
|-Body pane

The problem: I need to display the taxonomy and "other fields" in both views and in Panelizer, but I can't figure out how to do it without having to repeat creating the field output in each instance. To make things more complex, I need to filter Vocab B for a single term; which requires the Views Conditional module.

Problem 1: I can add the taxonomy and other fields to View 1's master view, so I don't have to repeat adding the fields to both panes; but there's no way to group those fields and settings so I can sync them to View 2.

Problem 2: As far as I know, Panels doesn't support conditional filtering when adding node fields to Panelizer; requiring me to create a new views content pane, so I can use the Views Conditional module filter a specific term in Vocab B. This is better anyway, since I don't want to have to manually add each individual field as a panel to the panelizer page.

So, I've created this view, and added it to the panelizer page. This is exactly what I want for this use case.

View 3: Product Metadata

|-Product Metadata (content pane)
| |-Vocab A term reference (filtered using Views Conditional module)
| |-Vocab B term reference
| |-Other fields

But now I'm back to Problem 1, I have 3 separate views that need to show the same group of fields with identical settings, but I need to manually create each instance of the fields on each view. There's got to be a better way! Any help would be appreciated. Thanks!

  • It occurred to me after writing this that I could probably manage this problem programmatically using Views API and possibly Features (Views 1 and 2 are already managed by Features). So, I would export View 3 as a Features submodule with Views 1 and 2 as dependencies, and use Views API to modify View 1 and 2 to match View 3. – ridgek Feb 11 at 22:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.