Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#151 2009-03-10 23:28:08
Re: [plugin] [ORPHAN] rss_auto_excerpt
I’m glad that worked!
Textile converts straight quotes like this " to curly quotes like this “ —which is good for typesetting, bad for code samples.
Offline
#152 2009-04-06 01:27:25
Re: [plugin] [ORPHAN] rss_auto_excerpt
I had to use this ‘hack’ to get the skipparagraphs attribute to work. Can anyone confirm that this attribute works at all without the hack? This attribute is even used as an example in the plugin help docs. Maybe this is a problem that arose with some Txp core update.
I find it very convenient to use the first paragraph of an article as excerpt. It leaves a nice juicy excerpt field open in all my articles for something more creative.
But some articles start with pictures, movies, headings, etc., so I end up just copying the first real paragraph up at the very beginning of every article. Then I just need to skip it when displaying the whole article, so I’m replacing <txp:body /> with:
<txp:rss_auto_excerpt skipparagraphs="1" paragraphs="9999" showlinkwithexcerpt="0" overrideexcerpt="1" />
As this hack is introducing some minor tag trace errors in my individual article pages, does anyone know of a more elegant way to skip the first paragraph? I tried wrapping the first paragraph with <txp:if_article_list> but it doesn’t work for some reason; it still displays on individual articles. Doing the inverse with <txp:if_individual_article> didn’t work perfectly either; I forget exactly what the behavior was but something wasn’t showing up where it should have.
EDIT: I guess using a custom field to store the first paragraph in articles that don’t actually start with the paragraph would actually be more convenient than doing the extra work of copying every first paragraph to the beginning of every article.
Last edited by aswihart (2009-04-06 23:26:34)
Offline
#153 2009-05-22 08:48:32
Re: [plugin] [ORPHAN] rss_auto_excerpt
Eureka… A solution to my issue with this plug-in…
function strip_tags_attributes($string,$allowtags=NULL,$allowattributes=NULL){
if($allowattributes){
if(!is_array($allowattributes))
$allowattributes = explode(",",$allowattributes);
if(is_array($allowattributes))
$allowattributes = implode("|",$allowattributes);
$rep = '/([^>]*) ('.$allowattributes.')(=)(\'.*\'|".*")/i';
$string = preg_replace($rep, '$1 $2_-_-$4', $string);
}
if(preg_match('/([^>]*) (.*)(=\'.*\'|=".*")(.*)/i',$string) > 0){
$string = preg_replace('/([^>]*) (.*)(=\'.*\'|=".*")(.*)/i', '$1$4', $string);
}
$rep = '/([^>]*) ('.$allowattributes.')(_-_-)(\'.*\'|".*")/i';
if($allowattributes)
$string = preg_replace($rep, '$1 $2=$4', $string);
return strip_tags($string,$allowtags);
}
Insert this code at the end of the plug-in, and then use it as a replacement for the strip_tags function around line 39:
$body = ($striptags) ? strip_tags($body,"img") : $body;
Change the strip_tags call in the code above to strip_tags_attributes and nested tags will not break the plug-in as often… I have yet to try it with an article that has a flash video embedded. I will try that next.
Offline
#154 2009-05-29 00:43:12
Re: [plugin] [ORPHAN] rss_auto_excerpt
Is there an attribute in order to not show the Read more link… (I need to place one somewhere else and right now I have two.)
Offline
#155 2009-05-29 01:23:44
Re: [plugin] [ORPHAN] rss_auto_excerpt
@dl33 Is this what you need?
showlinkwithexcerpt="0"
from the plugin help file:
showlinkwithexcerpt: Determines whether the permlink to the article will be shown when the automatic excerpt is displayed.
Last edited by johnstephens (2009-05-29 01:24:41)
Offline
#156 2009-05-30 00:04:56
Re: [plugin] [ORPHAN] rss_auto_excerpt
@johnstephens: Thanks, that worked.
Offline
#157 2009-08-31 14:24:26
Re: [plugin] [ORPHAN] rss_auto_excerpt
Is anybody else experiencing strange behavior with this plugin under Textpattern 4.2.0? I noticed that some of my excerpts are way longer than specified in the tag— for instance:
This…
<txp:rss_auto_excerpt striptags="1" sentences="3" showlinkwithexcerpt="0"/>
…gives me a three paragraph excerpt. Formerly, I set it to paragraphs="1" and got the entire article as the excerpt. Something is amiss.
This behavior may be triggered with striptags="1"— this, code works as in every ealier version of Textpattern:
<txp:rss_auto_excerpt paragraphs="1"/>
One paragraph, no fuss.
Offline
#158 2009-09-01 14:21:09
Re: [plugin] [ORPHAN] rss_auto_excerpt
@johnstephens I’m having the same problem, truncation is not happening.
Maybe it’s me — not used this plugin before.
I am on the 4.0.8 branch from Gerhard Lazu (glz_custom_fields).
At LAST I’ve cheerfully donated to the core devs at #TXP. I only wish I were able to give more. Thanks to the devs and ALL fellow TXPers. -A
Offline
#159 2009-09-01 14:29:12
Re: [plugin] [ORPHAN] rss_auto_excerpt
Woo! I guess I’m not crazy then. I never noticed any problems with this plugin under 4.0.8, but I wasn’t using Gerhard’s fork.
I wonder if anyone will adopt this very useful plugin?
Offline
#160 2009-09-01 16:37:36
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: [plugin] [ORPHAN] rss_auto_excerpt
johnstephens wrote:
Is anybody else experiencing strange behavior with this plugin under Textpattern 4.2.0?
Yes, me too, but are you sure it wasn’t happening before 4.2.0?
This behavior may be triggered with
striptags="1"
I am using paragraphs="2" with striptags="0", so there were no problems. When I change the striptags value to 1, the entire article is displayed. But now that I think about it, if the paragraph tags are stripped, how can the plugin recognise (and count) the paragraphs?
In another place I’m using words="30" striptags="1", no problem there.
Offline
#161 2009-11-19 10:28:52
- sams101
- Member
- Registered: 2009-11-09
- Posts: 23
Re: [plugin] [ORPHAN] rss_auto_excerpt
Hi there,
The plugin is working fine. Just having a little issue working out how to place the ‘Read more’ link into the same line as the excerpt. I know there has been an addition to the plugin for this (wrapreadmore), however I’m a little confused as to how to use this. Have tried a few variations, but no luck. Also, as the wilshereone site seems to be down right now, i’m wondering if I have the latest version of the plugin it says 0.5 but there is no wrapreadmore tag in the help file).
Here is my code is it stands right now:
<txp:if_article_category name="blog">
<h4><txp:permlink class="caller"><txp:title /></txp:permlink></h4>
<txp:rss_auto_excerpt length="340" showlinkwithexcerpt="0" wrapreadmore="1" ending="..." linkwraptag="span" />
<txp:permlink>Read more</txp:permlink>
</txp:if_article_category>
Any feedback on this will be really appreciated,
Offline
#162 2009-11-19 15:57:30
Re: [plugin] [ORPHAN] rss_auto_excerpt
OK, here my code for the article list on the homepage:
<txp:rss_auto_excerpt length="550" showlinkwithexcerpt="0" linktext="Mehr …" ending="…" overrideexcerpt="1" striptags="1" linkwraptag="strong" excerptwraptag="p" />
Parameter showlinkwithexcerpt="0" is responsible for not showing the link at the end of the paragraph. I used to show the link and this is why all the necessary arguments are still in the form.
From the help:
showlinkwithexcerpt
Determines whether the permlink to the article will be shown when the automatic excerpt is displayed. Default value: 1
Alternative: showlinkwithexcerpt=“0”
And yes, AFAIK 0.5 is the latest version.
Last edited by merz1 (2009-11-19 15:57:47)
Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML
Offline
#163 2009-11-19 23:25:32
- sams101
- Member
- Registered: 2009-11-09
- Posts: 23
Re: [plugin] [ORPHAN] rss_auto_excerpt
Markus, first of all, thanks for the response, you have been most helpful on these forums!
The problem I was having was that I was specifying my own link tag instead of using ‘linktext’. So thanks for looking into that.
Just wondering how i set the style on the perm link now? As due to it being part of the rss_auto_excerpt I seem to be having trouble styling it. Looks like it should be ‘link class’ doesn’t seem to be working for me.
Working with this at the moment:
<h4><txp:permlink class="ptext"><txp:title /></txp:permlink></h4>
<txp:rss_auto_excerpt length="256" showlinkwithexcerpt="1" linktext="Read more" ending="..." overrideexcerpt="1" striptags="1" excerptwraptag="p" wrapreadmore="1" linkwraptag="span" linkclass="ptext" />
http://hellosam.co.uk/textpattern/
Sam
Last edited by sams101 (2009-11-19 23:34:04)
Offline
#164 2009-11-19 23:44:52
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: [plugin] [ORPHAN] rss_auto_excerpt
sams101 wrote:
Looks like it should be ‘link class’ doesn’t seem to be working for me.
Note that this doesn’t add a class to the <a> tag, but wraps a <span class="ptext"> around it. So don’t style a.ptext, but .ptext a.
Last edited by els (2009-11-19 23:45:54)
Offline
#165 2009-11-20 11:01:06
- sams101
- Member
- Registered: 2009-11-09
- Posts: 23
Re: [plugin] [ORPHAN] rss_auto_excerpt
aha, that’s what happens when I stare at tags for days, cheers Els. Sorted.
Offline