Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2025-06-21 04:28:05

agovella
Member
From: Houston, TX
Registered: 2005-05-01
Posts: 82
Website Twitter

txp:image outputs img element with trailing slash

This is my txp tag:
<txp:image class=“article-image” height=“0” width=“0” />

It outputs this HTML:
<img src=“https://pxd.gd/images/23.png” alt=”“ class=“article-image” />

Is there a way to remove the trailing slash from the img element?

Offline

#2 2025-06-21 19:11:44

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,937
Website GitHub

Re: txp:image outputs img element with trailing slash

This and other standalone tags are corrected in the forthcoming 4.9, which is all but ready and certainly usable.

With 4.8, you‘ll need to use a search and replace plugin. Maybe the trim="/>" replace=">" attributes work on the txp:image tag; I can‘t remember if they work on v4.8. The other option is to write out the img tag manually abd insert the relevant attributes using txp:image_url and txp:image_info.


TXP Builders – finely-crafted code, design and txp

Offline

#3 2025-06-21 21:59:19

agovella
Member
From: Houston, TX
Registered: 2005-05-01
Posts: 82
Website Twitter

Re: txp:image outputs img element with trailing slash

jakob wrote #339884:

This and other standalone tags are corrected in the forthcoming 4.9, which is all but ready and certainly usable.

Sounds like maybe installing the latest 4.9 might be the way to go.

Last edited by agovella (2025-06-21 21:59:30)

Offline

#4 2025-06-24 04:03:22

agovella
Member
From: Houston, TX
Registered: 2005-05-01
Posts: 82
Website Twitter

Re: txp:image outputs img element with trailing slash

I installed the 4.9 beta, and like magic, all the trailing slashes in my img tags disappeared.

Smooth installation, too. And everything seems to be working.

Offline

#5 2025-06-24 13:49:45

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,368
GitHub

Re: txp:image outputs img element with trailing slash

jakob wrote #339884:

This and other standalone tags are corrected in the forthcoming 4.9, which is all but ready and certainly usable.

jakob is correct, we’re close to release for 4.9.0…there are some issues outstanding but the list is getting shorter.

Offline

Board footer

Powered by FluxBB