1

I develop a site which presents content along with multiple blocks of information on side bars. They're context related by nature, so I decided to use panels instead of block module.

That approach worked great for some time and was flexible enough. I created multiple view panes and passed the arguments through panel contexts.

But soon I realized there is a problem. I have a bunch of pages on a site which usually implemented using views pages. But they must more or less share the same side bars. So they must be panel pages too.

But there is a dozen or so of panes on a panel, so copying panel content (say, by using export and import) creates an awful mess and redundancy which greatly hampers maintenance and subsequent changes.

I'm thinking about creating all the pages in code by customizing one rough part created through gui. But I'm hesitating whether it's a good way. Any ideas?

1

Why not use mini panels, one of the sub-modules of Panels. Mini-panels are just like panel pages except that instead of taking a path and acting like a page they act like blocks. They are specifically designed to be embedded in other panels/pages.

So you can make a mini panel called sidebar and then if you ever have to make a change just update it in one place.

  • Thanks, Patrick. Interesting idea :) Could you please elaborate a bit more? Are you proposing to use them as Drupal blocks or to embed them into panel pages? Can I pass context information to them? – Dmitry Vyal May 11 '12 at 8:15
  • 1
    You should embed them within your panel pages, which will allow you to pass context information to them just like a regular panel. – Patrick Kenny May 11 '12 at 8:19
1

Mini-panels were not in option in my cause because of a custom panel layout containing multiply panel regions. But I found quite a nice solution.

I created a panel with a path wildcard and setup a context based on it in arguments tab. After that I added all the needed views on a page and setup visibility rules based on string comparison. Views in a main panel region shown on positive match and corresponding overviews on the right side - on negative.

This way I have only three panels - one for nodes, another one for taxonomy and third for all the auxiliary views.

1

In the Panels universe, the intended solution for this problem is Panels Everywhere.

With it, you can "wrap" your entire page layout built with Panels, in an outer Panel, called the "Site template". As site template support variants, just like all other Panels, you can create one variant that displays all the sidebar content next to your Views, and a second site template that does not.

  • Thanks, although my problem is mostly solved for now, I'll definitely try this module. – Dmitry Vyal May 14 '12 at 6:51
  • 1
    Yes, I realized that you had already found a solution, but I wanted to contribute my answer anyway as I believe it adds important information. – Letharion May 16 '12 at 13:38
  • I can't say I found a perfect solution :) I realized I have problems with custom pages, like search and registration. Since I rely on panels to render all the needed blocks of information, these system pages look naked now. – Dmitry Vyal May 17 '12 at 12:17

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.