# Image with alt

**URL:** <https://forum.modmore.com/t/image-with-alt/2104>\
**Category:** ContentBlocks\
**Created:** [July 22, 2020, 10:33am UTC](https://forum.modmore.com/t/image-with-alt/2104 "2020-07-22T10:33:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jamesgardiner](https://forum.modmore.com/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@Jamesgardiner](https://forum.modmore.com/u/Jamesgardiner)\
**Post date:** [July 22, 2020, 10:33am UTC](https://forum.modmore.com/t/image-with-alt/2104/1 "2020-07-22T10:33:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mhamstra](https://forum.modmore.com/user_avatar/forum.modmore.com/mhamstra/32/459_2.png) [@mhamstra](https://forum.modmore.com/u/mhamstra)\
**Post date:** [July 28, 2020, 2:43pm UTC](https://forum.modmore.com/t/image-with-alt/2104/2 "2020-07-28T14:43:15Z")

</div>

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

`[[+title:trim:htmlent]]`

---

<div class="post-metadata">

**Author:** ![Jamesgardiner](https://forum.modmore.com/letter_avatar_proxy/v4/letter/j/51bf81/32.png) [@Jamesgardiner](https://forum.modmore.com/u/Jamesgardiner)\
**Post date:** [July 28, 2020, 4:50pm UTC](https://forum.modmore.com/t/image-with-alt/2104/3 "2020-07-28T16:50:56Z")

</div>

`striptags` does it – thanks for the pointer.

---

<div class="post-metadata">

**Author:** ![mhamstra](https://forum.modmore.com/user_avatar/forum.modmore.com/mhamstra/32/459_2.png) [@mhamstra](https://forum.modmore.com/u/mhamstra)\
**Post date:** [June 15, 2022, 1:01am UTC](https://forum.modmore.com/t/image-with-alt/2104/4 "2022-06-15T01:01:48Z")

</div>

Split this topic on June 15, 2022, 1:01am UTC

3 posts were split to a new topic: [Questions about image field](https://forum.modmore.com/t/questions-about-image-field/2365)
