Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#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
Ignore the meta tag stuff.
Offline
Re: Output excerpt without <p> wraptag
masa wrote:
Ignore the meta tag stuff.
Wouldn’t that remove ALL tags and not just the wrapping <p>
tags?
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
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
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
Pages: 1