Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#6 | multiple_tabs_0.patch | 2.39 KB | Wim Leers |
#5 | full_page_screenshot.png | 140.58 KB | Wim Leers |
#3 | screenshot_37.png | 9.96 KB | Wim Leers |
#1 | panelsblock.css_.txt | 71 bytes | Wim Leers |
multiple_tabs.patch | 4.34 KB | Wim Leers |
Comments
Comment #1
Wim LeersAnd 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!
Comment #2
nedjoI 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.
Comment #3
Wim LeersI'll reroll tomorrow, here's a screenshot already.
Comment #4
nedjoThanks, 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.
Comment #5
Wim LeersI hope this is what you want then.
Comment #6
Wim LeersAnd refactored patch...
Comment #7
Wim LeersNote that it also might make more sense for the "Display style" select to come before the "Display area' dropdown, IMHO.
Comment #8
nedjoThanks 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?
Comment #9
Wim LeersI 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)
use case 2: multiple tabs
And finally...
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.
Comment #10
nedjoThanks 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?
Comment #11
Wim LeersOkay, 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
Comment #12
nedjoI 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
Comment #13
Wim LeersI don't understand the part I've marked. Could you please elaborate on that?
Comment #14
jasonwhat CreditAttribution: jasonwhat commentedI 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.
Comment #15
Wim LeersI 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))