buttonbox icon indicating copy to clipboard operation
buttonbox copied to clipboard

Aliases for image buttons

Open nathanchicken opened this issue 6 years ago • 1 comments

When specifying an image for a button, it'd be nice to be able to use aliases. This way, in different environments, staging, local etc we can better control the paths to those buttons when databases get synchronised rather than having to hope that absolute paths match up.

Thanks!

nathanchicken avatar Jul 17 '19 09:07 nathanchicken

Modify the following line in /supercool/buttonbox/src/templates/_components/fields/buttons/input.twig

{% if option.imageUrl %}<img src="{{ option.imageUrl }}"{% if option.showLabel %} class="buttonbox-buttons__with-label"{% endif %} {% if not option.showLabel %} title="{{ optionLabel }}"{% endif %} />{% endif %}

to

{% if option.imageUrl %}<img src="{{ alias(option.imageUrl) }}"{% if option.showLabel %} class="buttonbox-buttons__with-label"{% endif %} {% if not option.showLabel %} title="{{ optionLabel }}"{% endif %} />{% endif %}

haabe avatar Aug 14 '19 10:08 haabe