- Issue created by @pinesso
Iād like to propose an improvement for the Ping-Pong component in the IXM Blocks module. Currently, the shadow-lg class is hardcoded into the template as shown below:
{% set pp_classes = [ 'ping-pong-item', 'shadow-lg', not loop.first ? 'mt-5', ] %}
In some scenarios, applying this class by default may not suit all needs. To provide greater flexibility, I propose making this class optional. This would allow users to enable or disable it via a configuration option within the Ping-Pong block settings, similar to how the Reversed option is handled.
Here is an example of the Reversed option implementation that could be used as a reference:
{# If the "Reversed" option is checked, add it to our row. #}
{% set reversed = false %}
{% if 'Reversed' in item['#paragraph'].field_ping_pong_options.value %}
{% set reversed = true %}
{% endif %}
{# If the "Shadow" option is checked, apply the shadow-lg class. #}
{% set shadow = false %}
{% if 'Shadow' in item['#paragraph'].field_ping_pong_options.value %}
{% set shadow = true %}
{% endif %}
{%
set pp_classes = [
'ping-pong-item',
shadow ? 'shadow-lg',
not loop.first ? 'mt-5',
]
%}
This solution would offer more control over the visual presentation of the Ping-Pong component without requiring template overrides.
Thank you for your consideration. I believe this improvement would be beneficial for developers who require customizable styling.
Active
1.0
User interface