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

Comments

nedjo’s picture

Title: Panels block compatible with new Panels 2? » Panels block version compatible with Panels 2
Category: bug » feature

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.

summit’s picture

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

summit’s picture

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

wim leers’s picture

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

wim leers’s picture

Assigned: Unassigned » wim leers
wim leers’s picture

Status: Active » Needs review
StatusFileSize
new10.77 KB

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.

wim leers’s picture

StatusFileSize
new11.7 KB

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.

wim leers’s picture

StatusFileSize
new11.68 KB

One more tiny improvement.

summit’s picture

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

summit’s picture

I meant the following template possibility:

----------------------------
|       |          |       |
|       |          |       |
|       |          |       |
----------------------------
|                  |       |
|                  |       |
|                  |       |
----------------------------
summit’s picture

I meant:

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

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

Greetings,
Martijn

summit’s picture

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

wim leers’s picture

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.

summit’s picture

Hi Wim,

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

greetings,
Martijn

wim leers’s picture

Status: Needs review » Closed (fixed)

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