Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aliases for image buttons #32

Open
nathanchicken opened this issue Jul 17, 2019 · 1 comment
Open

Aliases for image buttons #32

nathanchicken opened this issue Jul 17, 2019 · 1 comment

Comments

@nathanchicken
Copy link

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!

@haabe
Copy link

haabe commented Aug 14, 2019

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 %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants