0

Is it possible to add custom content to a custom Panels layout?

Specifically, I've created a layout with a couple of columns for a content type called 'Stuff' and I always want to add the same images in a certain column of the teaser (that means every node of the 'Stuff' content type has to contain these images). I created several custom content panes with these pictures, but I don't know how I can use them in the custom Panel layout or the content type.

Any ideas? Or is there a better way to achieve my goal?

1

You could place the images in a mini panel. Changes to the images would be done in the mini panel and would affect all nodes.

In Panels you can activate the Node view variant and create a panel (with a selection rule for the content type: Stuff). then use your Panel layout and place the mini panel in the column you want the images.

All nodes of the type stuff, should now use your layout with a mini panel holding your images. You can easily change the content of the mini panel and reuse it on other parts of your site.

Hope I understood your problem correct.

  • You perfectly understood my problem. Your answer seemed ideal, but strangely enough, the pictures don't show up in the Stuff's teaser, although I placed the Mini Panel in one of it's columns. It doesn't work when I use the "Add block field" option either. But when I do the same with the Full content type, it does work. Is it possible that this problem has something to do with the fact that I uploaded the images with the WYSIWYG module or that the Stuff teaser nodes are shown in a view? – Jeroen Jul 29 '13 at 22:20
  • Ahh... no you can't render a node teaser through Panels. I never got that it was the teaser mode you wanted changed. It might be possible to use Display Suite to do this, I'm not sure. You can always add the block/mini panel to a tpl file for you node teaser. Embed the mini panel with <code>$block = module_invoke('panels_mini', 'block_view', 'mini_panel_machine_name'); print $block['content'];</code> – Pontus Nilsson Jul 30 '13 at 6:47

Your Answer

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

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