Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2018-02-25 00:37:05

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

txp:excerpt rendering

I bet if we had a WTF!? forum category it would become more popular than How? or Troubleshooting in short order.

Anyway, here’s my WTF for the day since there’s no good other place for it…

I have this in an article form:

<txp:if_excerpt>
    <p class="excerpt"><txp:excerpt /></p>
</txp:if_excerpt>

This placeholder text in the excerpt field:

About the site.

And it’s rendering like this in the front-end:

<p class="excerpt"></p>
<p>About the site.</p>
<p></p>

So basically two empty p tag pairs, one with the class assignment, and the actual excerpt applied between them in a third paragraph instance.

WTF?! ;)

Offline

#2 2018-02-25 01:49:50

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,102
Website

Re: txp:excerpt rendering

That is Textile doing!

Either turn of Textile for that excerpt field to change your markup slightly:

<txp:if_excerpt>
    <div class="excerpt"><txp:excerpt /></div>
</txp:if_excerpt>

Edit:

Or, since you are using TXP 4.7dev, use the newly minted escape attribute

<txp:if_excerpt>
    <p class="excerpt"><txp:excerpt escape="p" /></p>
</txp:if_excerpt>

Last edited by phiw13 (2018-02-25 02:15:40)


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#3 2018-02-25 14:38:28

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: txp:excerpt rendering

So easy. Thank you!

Offline

Board footer

Powered by FluxBB