Symptom: when there is more than one panel with IPE, only first IPE works (but all IPEs are displayed)
Solution: use drupal_html_id() instead of hard-coded '#id'
I understand that this use case (page with more than one panel) is special, but fix is almost trivial.
(In parenthesis - no, this is not theoretical issue, I just faced it and fix helps)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

valthebald’s picture

Status: Active » Needs review
FileSize
745 bytes
merlinofchaos’s picture

Wait, how does this actually work? I've thought that the current UX, with the bar across the bottom, makes it nearly impossible to select which panel you're editing?

valthebald’s picture

FileSize
32.32 KB

That's how it looks before entering edit mode:
multiple_ipe.png
Without patch - only first 'Customize this page' works
With patch - all (I tested with 5 panels) 'Customize this page' buttons work and make appropriate panels editable.
Of course, it would be better to position each buttons block close to its panel, and maybe add some indication of what panel is going to be edited, but I don't know how much work it would require.
Given the rareness of the use case, I thought that drupal_html_id() fix is enough

valthebald’s picture

Here's modified patch:
1) Positions page to the edited panel (using window.location.hash)
2) Show edit controls only for edited panel
3) Change 'Customize this page' to 'Customize {$this->display->title}'
Result:
multiple_ipe_4.png

valthebald’s picture

...I guess it's better to use

$this->display->get_title()

, not

$this->display->title
grasmash’s picture

This patch does fix the underlying problem by allowing multiple in place editors on a single page. However, the title property does not seem to load correctly.

grasmash’s picture

Issue summary: View changes
FileSize
2.01 KB

I've revised the patch slightly by:

* removing the unused hash setting (debug kruft?)
* using the existing this.topParent property in place of the new context var
* defaulting the title to $this->clean_key (better than multiple 'unnamed page' buttons)

I've tested functionally and it works well.

kyvour’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +panelizer, +ipe

Thank you for the last patch!!! I have a same problem with multiple IPEs on page. When I used paragraphs module with panelizer and IPE - I got this problem. After applaying panels-multiple-1928402-7.patch multiple IPEs works good.

The last submitted patch, 1: multiple-ipes-1928402.patch, failed testing.

The last submitted patch, 4: multiple-ipes-1928402-4.patch, failed testing.

The last submitted patch, 5: multiple-ipes-1928402-5.patch, failed testing.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 7: panels-multiple-1928402-7.patch, failed testing.

msupko’s picture

@grasmash's patch in #7 worked great for me as well...however, the patch no longer applies cleanly. Here's a re-roll.

Dave the Brave’s picture

I rerolled with a slight modification to check the display title since get_title will honor the hide_title setting. I wanted to use the title regardless of it being hidden since the use is for the button and not the panel itself.

This is useful if you have the same use case, such as a custom module or feature defining the panel title but where the IPE button is showing a not-so-pretty clean version of the cache key.

NWOM’s picture

Any progress on this front? This patch is sadly necessary for Panels Everywhere IPE functionality. See #1822312: Panels IPE Support in Panels Everywhere