Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-07-01 17:05:51

dressedinvalue
Member
From: Louisville, KY
Registered: 2008-12-31
Posts: 21

Output excerpt without <p> wraptag

Is it possible to output the txp:excerpt without an html tag wrapping around it, without using notextile in the excerpt content?

Please say yes. :)

Offline

#2 2009-07-01 17:11:51

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: Output excerpt without <p> wraptag

Yes

Ignore the meta tag stuff.

Offline

#3 2009-07-01 17:13:59

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: Output excerpt without <p> wraptag

masa wrote:

Yes

Ignore the meta tag stuff.

Wouldn’t that remove ALL tags and not just the wrapping <p> tags?


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#4 2009-07-01 17:17:15

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: Output excerpt without <p> wraptag

MattD wrote:

Wouldn’t that remove ALL tags and not just the wrapping <p> tags?

Yes, that strips everything. I assumed that’s what dressedinvalue wanted, if not, sorry.

Offline

#5 2009-07-01 17:33:59

nabrown78
Member
From: Northampton, MA, USA
Registered: 2006-10-04
Posts: 294
Website

Re: Output excerpt without <p> wraptag

I think if you just wanted to eliminate paragraph tags, you could do this:

<txp:php>
       global $thisarticle;
       assert_article();
       $my_excerpt = str_replace('<p>', '', $thisarticle['excerpt']);
       echo str_replace('</p>','',$my_excerpt);
</txp:php>

Is that right?

Offline

#6 2009-07-01 18:24:23

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Output excerpt without <p> wraptag

Bit more user friendly with help of rah_replace could be:

<txp:rah_replace from="<p>,</p>" to="">
	<txp:excerpt />
</txp:rah_replace>

Last edited by Gocom (2009-07-01 18:25:05)

Offline

#7 2009-07-01 18:28:37

dressedinvalue
Member
From: Louisville, KY
Registered: 2008-12-31
Posts: 21

Re: Output excerpt without <p> wraptag

Hey thanks everyone. Gocom’s suggestion of the rah_replace plugin works perfectly, and is super easy to use.

Many thanks!

Offline

Board footer

Powered by FluxBB