Changes
Added support for multiple tabs.
When you mark a Panel to become a Panelsblock, it will now create a tab for each area in the Panel, instead of only one tab (for the left area).

Remarks
The CSS has been set to make the background color of the block transparent (all other blocks are transparent by default). This makes it so that the block just blends in with the theme you're using. Originally, it would always have a grey color.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Wim Leers’s picture

FileSize
71 bytes

And the new .css file. (Added .txt extension just for uploading, .css is not allowed.)

The development was sponsored by Paul Ektov of http://autobin.ru!

nedjo’s picture

I guess this makes sense.

Could you give a screenshot to show what the result looks like?

I'm trying to remember what I was thinking when I limited it to one area.... I can't recall a good reason for the limitation.

We've made some changes to the module. Could you please refresh the patch, and ensure the patch is on HEAD? Thanks.

Wim Leers’s picture

FileSize
9.96 KB

I'll reroll tomorrow, here's a screenshot already.

nedjo’s picture

Thanks, What I mean though is, a screenshot of a full page with multiple tabsets, one per panels area. That's what I'm trying to picture.

Wim Leers’s picture

FileSize
140.58 KB

I hope this is what you want then.

Wim Leers’s picture

FileSize
2.39 KB

And refactored patch...

Wim Leers’s picture

Note that it also might make more sense for the "Display style" select to come before the "Display area' dropdown, IMHO.

nedjo’s picture

Thanks for the patch.

I misunderstood at first the point of this patch.

At present, we select a given region, and all items in that region are placed on tabs.

I thought the patch was to do the same, only have one set of tabs per panels area.

It seems, however, that the point is to have one tab per area. Each area becomes a tab, but its contents are not tabbed.

I don't really see that as an improvement. The same effect can be achieved at present, can't it? Make a panels page, add other panels to it. It also clashes with the regular behaviour of exposing a panels page as a block.

It might be worth considering having both, though. That is, if there is more than one area, each area is a tab, and the content on it are tabs. That facilitates multi-level tabs. If there is only one area, the behaviour is just like it is at present.

Wim, what do you think of this? Is it something you'd like to code?

Wim Leers’s picture

I was unaware of that possibility. Nor was my client. I haven't seen that documented anywhere and IMHO it's far from trivial. It's very obscure. This patch makes the use straightforward.

use case 1: single tab (as it is now)

  • before: Expose a panel as a block and define the area to be used.
  • after: Identical, but make sure that the panel has only one area in use.

use case 2: multiple tabs

  • before: What you suggest is, expose a panel as a block. The first tab will be the the left area of this panel. The other tabs can be defined by adding panels to the other areas of the first panel. If this is what you mean, this doesn't make much sense IMHO.
  • after: Expose a panel as a block, and each area gets a tab. That makes sense.

And finally...

Each area becomes a tab, but its contents are not tabbed.

First part: yes. Second part: huh?

Overall, it seems that I interpreted your conceptual model completely different. Which means there's quite some ambiguity in this module. Note that the way this patch changes how things work, is consistent with the "Default panels" display style, where you choose which area of the panel to display. When you choose "tabs" after applying my patch, *all* areas will be accessible, through tabs. IMHO that makes a lot of sense.

Sorry for the long explanation, I hope it makes my conceptual model of this module clear. It's late so I'm sure it's not written very well.

nedjo’s picture

Thanks for your response.

Let me start by clarifying how the module works at present.

To create a tabset, you:

1. create a panels page. I typically use a one column panels page (requires a patch last I checked).

2. Add content to an area on that panels page.

3. Choose to expose this panels page as a block, and select tabs.

When you display the panels page - either in a block or, more commonly, on another panels page (as a 'block' panel), you get each item you added to the area on a separate tab.

If you want nested tabs, you create a new panels page and add the first one you created as a block to the new panels page, then repeat step 3 for the new page.

Does this meet your use case? Is there something missing? What different use case is your patch intended to meet?

Wim Leers’s picture

Okay, I finally understand how it works now.

The advantage of my approach is that you can truly reuse normal (usable) panels as blocks. The way you are offering multiple tabs and nesting, requires some customly configured panels - panels that are "for internal use only".

Nonetheless, your approach works too, and it makes sense. But I still think my approach is more userfriendly - although I did this partially unknowingly :P

nedjo’s picture

I think I'd like to see a combination of both, see the last two paragraphs of comment #8, above, http://drupal.org/node/147366#comment-256576

Wim Leers’s picture

That is, if there is more than one area, each area is a tab, and the content on it are tabs.

I don't understand the part I've marked. Could you please elaborate on that?

jasonwhat’s picture

I think you are both talking about the same problem and same desire by module users: we want to have an easy way to create js tabbed pages and blocks.

My idea: why not go further back, to the selection page where users choose to have their panel as one col, two col, two col stacked, etc. and add an option for tabs. They could then have as many tabs as they like, and have multiple views, nodes, custom contents, blocks, whatever in each tab.

I have no idea the technical implications of this, but it seems like the most user-friendly way to do this.

Wim Leers’s picture

Status: Needs review » Closed (won't fix)

I am wontfixing this patch, because the functionality was in fact already implemented, it was simply a badly documented feature. It actually makes a lot of sense. The other reason is that Panels 2 is out, so we should be looking at that instead. See my patch at this issue, that aims to make Panelsblock compatible with Panels 2.
I was actually just executing what my client asked while creating this patch. I did try out the module first, but it was not obvious to me either.

What nedjo suggested in #10 also makes a lot of sense: multi-level tabs. Top level tabs = areas. Second level tabs = panels in each
area.

@jasonwhat: what you are describing is actually what this patch does. Only you can not select the areas that should be turned into tabs, it always uses all areas.
Please look for the panels_mini.module, which will make all of this MUCH easier. It'll be one of the "sistermodules" of Panels 2.

@nedjo: this module will pretty much become obsolete when panels_mini.module will be available. Let me explain: Panels 2 consists of two modules, panels.module and panels_page.module.
-panels.module is the low end implementation.
-panels_page.module is an UI to create a page consisting of panels.
-panels_mini.module (not yet ready, I'll work on this) is an UI to create a block consisting of panels (panes actually)
(For the record: there's also panels_node.module.(not yet ready))