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.
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)
Comment | File | Size | Author |
---|---|---|---|
#14 | panels-multiple-1928402-14.patch | 1.81 KB | Dave the Brave |
#13 | panels-multiple-1928402-13.patch | 1.64 KB | msupko |
#7 | panels-multiple-1928402-7.patch | 2.01 KB | grasmash |
#5 | multiple-ipes-1928402-5.patch | 1.68 KB | valthebald |
#4 | multiple-ipes-1928402-4.patch | 1.55 KB | valthebald |
Comments
Comment #1
valthebaldComment #2
merlinofchaos CreditAttribution: merlinofchaos commentedWait, 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?
Comment #3
valthebaldThat's how it looks before entering edit mode:
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
Comment #4
valthebaldHere'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:
Comment #5
valthebald...I guess it's better to use
, not
Comment #6
grasmash CreditAttribution: grasmash commentedThis 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.
Comment #7
grasmash CreditAttribution: grasmash at Acquia for U.S. Department of Justice commentedI'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.
Comment #8
kyvour CreditAttribution: kyvour commentedThank 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.
Comment #13
msupko CreditAttribution: msupko as a volunteer commented@grasmash's patch in #7 worked great for me as well...however, the patch no longer applies cleanly. Here's a re-roll.
Comment #14
Dave the Brave CreditAttribution: Dave the Brave commentedI 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.
Comment #15
NWOM CreditAttribution: NWOM commentedAny progress on this front? This patch is sadly necessary for Panels Everywhere IPE functionality. See #1822312: Panels IPE Support in Panels Everywhere