- Issue created by @Anybody
- 🇩🇪Germany Anybody Porta Westfalica
Does the Commerce team agree? Then we'd be willing to implement this as MR.
- Status changed to Needs review
3 months ago 6:01am 29 August 2024 - 🇩🇪Germany Anybody Porta Westfalica
I first thought about, if the solution should be more generic (like being able to select the
wrapper_element
and its state again as it was in Drupal 7), but this seems to be very specific to the (business) use-case on coupons. You typically don't want to nudge people looking for coupons (less revenue), but if they have a coupon, they should be able to enter it. This is what now the second client in a row asked for and it's now possible.The default and fallback is an open details container (that was a
container
) before.Please review.
- 🇮🇱Israel jsacksick
I wonder if we shouldn't expose a setting for each pane that allows overriding the default instead... So basically the following:
/** * {@inheritdoc} */ public function getWrapperElement() { return $this->pluginDefinition['wrapper_element']; }
would first look for a wrapper element in the configuration, and then fallback to the plugin definition.
Something like:/** * {@inheritdoc} */ public function getWrapperElement() { return $this->configuration['wrapper_element'] ?? $this->pluginDefinition['wrapper_element']; }
- 🇩🇪Germany Anybody Porta Westfalica
@jsacksick yeah as written in in #6 I thought about the same and I'm not sure if it's really needed for many other panes (like we had in D7). I'm absolutely not against it, but for coupons it's an important user-/business-focused functionality, while for others it might be nice to have edge-case.
So my feeling is that this should go in for coupons asap and we could discuss a general solution in the future as follow-up to not block this?
Do you know why the D7 setting was not kept?
And yes, I think basically container and details are most important, while we'd also have to add a setting for the default open state then for the containers with an#open
attribute. - 🇮🇱Israel jsacksick
So my feeling is that this should go in for coupons asap and we could discuss a general solution in the future as follow-up to not block this?
Not sure it has to go ASAP, remember that you can easily override this from your project...
Also you're changing the default wrapper, without an option for existing sites to opt out, meaning theming is potentially going to break without notice.Also, instead of exposing an extra setting for determining whether the "details" should be opened, we could probably copy the Webform approach:
'header' => $this->t('Header'), 'fieldset' => $this->t('Fieldset'), 'details' => $this->t('Details (opened)'), 'details-closed' => $this->t('Details (closed)'), 'container' => $this->t('Container (no title)'),
- 🇮🇱Israel jsacksick
Do you know why the D7 setting was not kept?
Honestly, no idea :).
- 🇮🇱Israel jsacksick
Opened ✨ Allow customizing the wrapper element and the display label for checkout panes Needs review which implements a more generic approach to this.
- Status changed to Closed: duplicate
3 months ago 3:24pm 29 August 2024 - 🇩🇪Germany Anybody Porta Westfalica
Closing this in favor of ✨ Allow customizing the wrapper element and the display label for checkout panes Needs review thanks to the great @jsacksick!