One Week With Panels 2 Beta 3

What follows is a slightly edited stream of emails i sent to one of our internal lists as I dove into Panels 2 Beta 3 last week. I hope to glean a more concise set of instructions and recommendations from this experience, but figured in the spirit of “Release early, release often” I would post this just in time for the end of Module Monday.

If you are familiar with Panels 2 Beta 3, you will see that I too became familiar with it over the span of these few days that I was working with it. So in the first entry when you find yourself thinking “Dude you need to add a panel view first!” be patient, I get to it. I think this speaks to some usability improvements that could be made, or documentation improvements, especially for folks who have already been using earlier versions of panels.

4/7 9:45pm

Argument handling functionality in Panels 2 Beta 3 has seriously changed since earlier versions with the addition of the context “tab” in panels configuration.

In earlier versions of panels (panels 1, and 2 beta 1) you could manually add an argument into the pane settings, thus you could use the same view in 3 panes in one panel and pass a different argument through each time. for example you could have a product view 3 times in the same panel and pass the arguments book, video, clothing thus economizing on how many panels you have.

Similarly you could manually add a specific taxonomy term id or name as an argument to pass through to the views that make up your panel.

The problem is that panels 2 beta 3, for all its goodness, doesn’t allow you to manually add an argument. It needs to pull it out of the url via the context system (from what I can tell).

Further more, you cannot, as far as I can tell, customize the settings of a view in the pane other than to change the title, but you can’t set the number of nodes to display, and you can’t seemingly decide whether you want to use a page, block or embedded version of the view.

All this said, I am still reading my way through the latest documentation now.

4/7 10:49pm

OMG: Panels 2 beta 3 breakthrough! I can go to sleep and rest easy!

I would argue that Earl has added an extra layer of complexity that in many cases will add to the time required to configure panels…. but I trust that the genius that brought us views and panels knows what he is doing better than I do.

So the answer to my question from earlier is that BEFORE adding the views as panes to a panel you really need to go to admin > panels > views and “add” your view as a panel, that is where the config about argument handling and paging info and all that sort of stuff is. I think that this should be called “Add View Pane” to eliminate confusion since you are not adding a view to your drupal site, rather you are adding an existing view to panels for use as a pane.

So the steps are

  1. create your panels admin/panels
  2. create your actual view admin/build/views (you could do this first)
  3. create your panel view (pane) admin/panels/views
  4. edit the panel you created and add your context
  5. edit the panel you create and add your view pane (create in 3 above)

I guess one benefit is that you can take the same view and create multiple panes with it and reuse those panes in one or many panels, whereas in earlier versions of panels if you “customized” the view upon inserting it in a panel, you could not reuse that customized instance (pane) of the view in another view.

The biggest “problem” I see with all of this is keeping everything straight and naming conventions. I imagine after I do this all once I will have a better idea a) of how it works and b) of what kind of naming convention might make sense.

My head is going to quietly explode on my pillow while I sleep.

4/8 10:45pm

Here is my latest tip:
When you are adding “views” panes (admin > panels > views) be sure to give good descriptions, or even rename the view, or append the name with some additional info, because the time will come when you have added the same actual view TWICE as two different panes, perhaps to use different context, or use an embed vs a block, and when that time comes, and you go to add your view pane into your panel, the popup dialog box only shows you the title of the view, which is not the name of the view, so could very well be the same across multiple views. The only way to distinguish one view from another in that case is to mouse over it and see the descriptions.

4/8 11:35pm

Oh, and another tip:

When you want to pass a term from the URL through the panel and into the views, your views panes should have the context “argument from panel” not context.

4/9 5:23pm

There is a feature under layout to “Add side bars” That has perplexed me for the last few days. Only today did I realize how this would be used.

If you have a multi row panel layout, and you want to drop the Drupal theme block regions from your panel, you will want to add a sidebar using this feature (left, right or both), here is the reason:
If you have multiple rows and columns in your panel, then you cannot have a continuous column that actually spans multiple rows. Now I imagine you can theme a column to extend as far as you want it to regardless of rows, but it would seem the RIGHT way to do it is to add a sidebar, which is, in effect a full length column.

Interestingly I think that you can have fixed with sidebars (by px width) and have fluid (by %) columns. This is another benefit of using this method. Your sidebars can remain a standard width while the content area can shrink and grow.

Discover more from Gregory Heller

Subscribe now to keep reading and get access to the full archive.

Continue reading