1

So as I've searched through drupal.stackexchange I see this question hasn't been fully answered, I guess it will be asked again and again until good solution is found I will try to summarize the problem and present found solutions.

Imagine a site which uses panels and views. The site has several areas, and each of them has its layout, its blocks and design differences. Every area can be represented by number of nodes and number of views.

So nodes are displayed by panels - they are wonderful to work with, you just create variant and specify the selection rules. All selected nodes have one variant, they share the same layout and have same blocks. Perfect! Pure pleasure to deal with!

What about views as a part of this structure? Since views are also part of the area, I want them ideally to appear in the same variant as the above node, but I can't. The out of the box way that is coming from design of the views and panels modules is like this: create view content pane, then create new panel with its own URL, then select it's layout, add the created view content pane, and then add and configure the same blocks, all just like in the previous paragraph.

Since there are a number of views in the same site area, this has to be done over and over again. And of course, support: in the case some block needs to be changed, then it has to be changed in all of the panels that present this site area. That's a lot of clicking overhead, prone to errors and.. just doesn't feel right!

There are four solutions that I found in the internet, but all of them are lacking the beauty and cleanliness.

  1. panels everywhere site template that would provide the required layout and blocks. Result: two variants to support (one in node panel, one in site template panel) and some CSS work since the blocks would be in different html hierarchy.
  2. panels multiple url module (dont remember the name) that would allow multiple urls to be routed through the same panel. Every view will require adding it's page url into the panel and then adding it to variant. Result: two variants to support, CSS: ok.
  3. special panel for all views. url of this panel would look like /view/%view_name/%argument1/%argument2/... After such panel is created, you will need an URL alias to be created too. Result: two variants to support, CSS: ok
  4. nodes acting as selectors for panels and views. every such "special" node is considered to be a view content and panels variant would remove the node itself and display a view content block instead. This could be the most beautiful way, but since it is a system panel, it lacks arguments that can be passed to view from url. So, no go. Result: one variant to support!! CSS: perfect! Minus: no support for arguments, so views with arguments would have to use another approach. Not perfect again.

Can anyone who has experience with panels/panels_everywhere in combination with multiple views on their sites shed some light on this? Which of these approaches do you prefer? Are you using any other, more flexible, way to do that (maybe context module or any other, that I haven't started digging yet)?

Update: a simple example. There is a part of site named "corpo pages", which includes several types of content (news, press_releases, available_jobs, Q&A and couple of other), and a number of views, listing all this content in different ways. All of them should have same layout and same blocks in the sidebar and below the content. So, viewing content nodes is covered by panels.
Then the issues start when trying to add 5 views. Creating new views with content panes is followed by creating new panels with duplicated everything inside. Which is sort of no problem because it all can be cloned, the hard time starts with support, when the user wants to remove or add a new block, he will have to carefully go through all panels repeating the same action over and over again. I can already see his pain because something will be definitely forgotten.

Mini panels does pretty good job here, reducing such support effort and minimizing the human factor. But it comes with a price of in-place editor not working and overall user experience.

5
  • "Since views are also part of the area, I want them ideally to appear in the same variant as the above node, but I can't." - Why not? If you're using the node_view panel page, can you not just add a Views content pane display to the node_view panel variant? Commented Nov 8, 2013 at 8:28
  • It is option number 4 in the question - it is really good solution for views that dont have arguments. If you have to have arguments, you cannot change the path that is already set up by the panels module: node/%nodeid, therefore - no arguments :( Commented Nov 8, 2013 at 8:33
  • 1
    In the case of passing arguments to the View, it's often easier to use the "Use exposed filters in panel pane configuration" setting on the content pane display in Views. That way the exposed filters become settings on the content pane form in panels. Commented Nov 8, 2013 at 8:34
  • Yes, but can you pass the parameters to the view through url? Views allow to be called like this: http:// example/view_name/argument1/argument2 How can you do it for node_view panel, it already has url predefined? Commented Nov 8, 2013 at 8:37
  • 1
    I think this question needs a rewrite to clarify what you are trying to accomplish. It is likely going to boil down to a combination of variants with selection rules based on the section, context configuration to get data into the variant (if needed), and views-as-panes in the content pulling in panel context for their configuration.
    – mpdonadio
    Commented Nov 8, 2013 at 17:21

1 Answer 1

1

If you have a consistent group of content panes that you want to appear in the same order with the same contexts, etc. in every variant, you can use a Mini panel, which is provided by the Mini Panel submodule of Panels.

That way, when you need to update one of the content panes, all you have to do is update the mini panel and all of the variants using that mini panel will automatically be updated.

2
  • Yes, I was also thinking about that, but still it is not perfect: you still have to do the rest of the overhead: create panel, select layout, etc. Beside that, I'm not sure is it possible to pass the context configured in the panel to blocks in mini panel which are separate unit now. In the end, if I don't find any "perfect" solution I will go either this way or one of the described. Commented Nov 8, 2013 at 8:31
  • 1
    Yes, you can pass the context. If the mini panel context is required, then the panel in which the mini panel is embedded must have the same context, which will then be passed to the mini panel when the panel is visited. Commented Nov 8, 2013 at 10:05

Your Answer

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

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