How to create a border + border colour field on an image My first question here... maybe one of a few! I've inherited a Craft project recently and don't have much experience with it.

I want to allow admin to set a border (and border color) whenever they add an image. Currently, the image field has a field type of Assets. I don't want to change the field type (to a Super Table or similar) because the component is used in so many other places - it would break.

We're using Craft 2 but upgrading to 3 presently.

Has anyone else had to do this before? Any suggestions on how to approach this? Let me know if I can clarify anything.
It looks like you're using a Matrix block with a field inside a block called Image. Given that information, I'd add a new field to that block called Border. You could either use a colour field, or a dropdown to set your own values. Then maybe something like this on the front end:

{% if block.image|length %}
&lt;img src="{{ block.image.one.url }}" {% if block.border|length %} class="bordered border-{{ block.border }}"{% endif %}&gt;
{% endif %}


Craft doesn't have any relation to the front end of your site intrinsically, so you could call the field whatever you like.