Image with alt

The standard image field produces a empty alt tag so I made a new “image with alt” using image_with_title as the basis.

The template property is has

img class=“img-fluid” src="[[+url]]" width="[[+width]]" height="[[+height]]" alt="[[+title:htmlent]]"

but CB always adds a BR to the title within the alt. How can I stop that?

Kind regards

James

I think MODX has a trim output modifier you could also use:

[[+title:trim:htmlent]]

striptags does it – thanks for the pointer.

1 Like