1

I have multiple different layout variations all for the same node type, is it possible to select which one will be used from the node edit form?

For example I have a node type of product which has the following layout variations:

  • 2 Column
  • 3 Column
  • 2 Column Hybrid

On the node edit for I would have then have a drop down (or something else) which allows me to select one of the variations listed above. Is this possible?

3 Answers 3

1

It sounds like you are using Panels (presumption based on the column names), so this is very easy to achieve.

In Page Manager, enable and edit node_view. Create a new panel variant. Enable Selection Rules for the variant. Add the selection rules "node_type = product" and "field_layout = 2 column".

Then carry on through the rest of the config, ie choose 2 column layout and put in your fields/blocks/etc. You will then have to create 2 more variants (or clone and edit the current variant), changing the selections rules and layout to suit.

1

You can use Panelizer for this purpose http://www.drupal.org/project/panelizer. Check this article for details http://drupalwatchdog.com/2/1/panelizer-layouts

1

I have done this using a combination of taxonomy and selection rules in Panels:

  • Create multiple layouts (variants)
  • Create matching terms in a "Layout" vocabulary.
  • Use the term as a selection rule for each layout.
  • Assign the vocabulary to each content type that should allow that layout choice. You can make it a dropdown or radio buttons (not checkboxes, obviously!).

Authors can then choose which layout to use when creating/editing a node.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.