Panels block version compatible with Panels 2

Summit - June 16, 2007 - 22:43
Project:Panels Block
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Wim Leers
Status:closed
Description

Hi,

I have the new Panels 2.0-alpha3 installed.
Is it a tweaking of settings that panels_block is not working?

If it not my tweaking, please make panels block panels 2.0 compatible.

Thanks in advance,
greetings,
Martijn

#1

nedjo - June 17, 2007 - 03:50
Title:Panels block compatible with new Panels 2?» Panels block version compatible with Panels 2
Category:bug report» feature request

No, it's not compatible. In Panels 2, the panels page construction UI moves to the panels_page module, so at a minimum there's a need to change the form id tested for in panelsblock_form_alter(). No doubt more extensive issues will arise.

I'd welcome a patch, in which case we could produce a new branch for Panels2 compatibility.

#2

Summit - June 17, 2007 - 21:39

Hi,

I hope someone will please make a patch?
Because Panels will go to Panels 2.0 and this module fits great into this!

greetings,
Martijn
www.gratis-informatie.nl

#3

Summit - July 2, 2007 - 08:49

Hi,

I am trying to make a patch.
The changes I understand are:
Line 16 Panels-block.module
Panels 1.2: 'panels_edit_form'
Panels 2.0: 'panels_page_edit'

Line 58 and 89 Panels-block.module:
Panels 1.2: 'panels_load_panels'
Panels 2.0: 'panels_page_load'

But I got stuck with the panels_is_panels_page function on line 105.
This function is gone in the new panels_page.module (panels 2.0)?

Can somebody please help make the patch?

Greetings,
Martijn

#4

Wim Leers - July 5, 2007 - 21:32

I'm working on a patch, that will be sponsored by autonetex.

#5

Wim Leers - July 5, 2007 - 21:37
Assigned to:Anonymous» Wim Leers

#6

Wim Leers - July 6, 2007 - 15:44
Status:active» needs review

Here's the patch (against HEAD). This is pretty much a complete rewrite of this module! I left as much code intact as possible, but it wasn't much.

First: an explanation of how Panels 2 names all parts, from the highest to the lowest level:
1) pid (numeric): panel page id, which is unique and a did (display id) for the layout is linked to it
2) panel (string): panel id, this is what was previously called "area"
3) pid (numeric): pane id, which is unique and configures a block/view/whatever, it's linked to a panel (2) in which it will be capsulated, it's also linked to the did (1)

This should help you understand the code.

Remarks:
- there's a work-around for a small bug in Panels 2 Alpha 5 included, which can be removed afterwards without any other side-effects (lines 44-49)
- I'm not sure if this is only possible thanks to Panels 2, but it definitely uses a very moduler rendering "engine", which allowed me to simply delete the content_types/*.inc files! (Which you should do too of course.) This makes the future maintenance of this module much easier!
- the flexible lay-out is supported, the panel names (previously areas) for these are generated automatically and are exactly the same as the names generated by Panels 2 itself
- you can still select one panel (previously an area) that should be displayed
- you can still choose either default or tabs as presentation, each pane in the selected panel gets a tab

You'll have to apply the patch to actually understand the changes, by reading just the patch, none of the changes make sense.

As said previously, this patch is sponsored by autonetex.

AttachmentSize
panels2compatibility.patch 10.77 KB

#7

Wim Leers - July 6, 2007 - 19:12

New version. Fixed problems with the panels_page_edit_form form in two cases:
1) The panels page is not yet saved.
2) The panels page does not yet have any panels with at least one pane added to it.

AttachmentSize
panels2compatibility_0.patch 11.7 KB

#8

Wim Leers - July 6, 2007 - 19:16

One more tiny improvement.

AttachmentSize
panels2compatibility_1.patch 11.68 KB

#9

Summit - July 7, 2007 - 13:26

Hi Wim,

I tried your patch and it's working, thanks!

But maybe an add-on functionality will improve this function.
Right now you can only select if you want to show one of the panel-panes.

Expose as a block
Select whether you wish to make this panels page available as a block.
Exposed panel: LeftRight
Select the panel that will be displayed. You cannot choose an empty panel.

Wouldn't it be better to be able to show the whole panel as a block?
With this than you can make panels together with block-functionality a look-and-feel like:
----------------------------
| | | |
| | | |
| | | |
----------------------------
| | |
| | |
| | |
----------------------------

Now with only one of the panel-panes shown with panel-block the above template (especially the top-left corner) is not possible to build with panels. Or am I incorrect?

Greetings,
Martijn

#10

Summit - July 7, 2007 - 13:28

I meant the following template possibility:

----------------------------
|       |          |       |
|       |          |       |
|       |          |       |
----------------------------
|                  |       |
|                  |       |
|                  |       |
----------------------------

#11

Summit - July 7, 2007 - 13:32

I meant:

| Panelsblock      | Other
                      pane
----------------------------
|       |          |       |
|       |          |       |
|       |          |       |

| Other pane       | Other
                       pane
----------------------------
|                  |       |
|                  |       |
|                  |       |
----------------------------

Greetings,
Martijn

#12

Summit - July 7, 2007 - 19:03

Hi Wim,

May be this post: http://drupal.org/node/77418 helps.
It is a simple php block combining others. May be it is usefull for panels-block?

Greetings,
Martijn

#13

Wim Leers - July 7, 2007 - 23:14

1. Your wording is wrong. A panels page has a layout, that defines panels (the areas in which you can drop stuff). The stuff you can drop into those panels are called panes.

2. I replicated the original functionality of Panelsblock. I'm not adding any extra features in this patch, it's enough work to review it already as it is.

3. The functionality you want, if I understood you right, can be achieved by putting all the panes you'd like to see in your panelsblock into ONE panel and then selecting that panel as the Exposed panel.

Wait for the panels_mini module for a better interface to do this. That module will probably make this module obsolete.

#14

Summit - July 7, 2007 - 23:35

Hi Wim,

Sorry for the wrong vocabulary.
Do you know when the panels-mini module will be available?

greetings,
Martijn

#15

Wim Leers - March 17, 2008 - 12:35
Status:needs review» closed

Panels 2 with Mini Panels have been out for months now. Closing this issue.

 
 

Drupal is a registered trademark of Dries Buytaert.