Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#109 2008-06-20 11:16:45
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,311
Re: [plugin] [ORPHAN] rss_auto_excerpt
Is the code example the original copied & pasted code? There are wrong apostrophes around the values of skiplength, overrideexcerpt, and striptags.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#110 2008-06-20 14:30:03
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: [plugin] [ORPHAN] rss_auto_excerpt
I understand that you have the book info (publishing date etcetera) inside the article body. Wouldn’t it be simpler to put that in the excerpt field if you’re not using that for something else? Then you’ll just have to add <txp:excerpt />
to your individual article form, and you don’t need the skipwhatever
attribute in the plugin tag.
Another way to do it (if you can’t use the excerpt field): make the book info a separate first paragraph in the article body, and use words="65" skipparagraph="1"
. (But you probably already tried that and the problem lies like Uli said in using the wrong quotes.)
Last edited by els (2008-06-20 14:32:04)
Offline
#111 2008-06-20 15:15:09
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,311
Re: [plugin] [ORPHAN] rss_auto_excerpt
Completely agree to any improvement. Then again, this is a live site with several hundreds of entries online and to be edited. Too much, I think.
I’ve also thought about custom fields for book info, as I wouldn’t leave to authors to be too precise (skiplength="500"
or words="65"
). But then it had to be checked for whether this is a new or an old article (i.e. pre-/post-change) by some if_custom_field tags.
Hmm, the more I think about it, the more likely it appears to be, that the custom field variant might even be easier to implement, regarding the changes it’d need to check for whether it’s an old or a new kind of excerpt. What do you think, Els?
Edit: Wild guess, we’d need some info on the actual use of the excerpt field.
Last edited by uli (2008-06-20 15:24:28)
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#112 2008-06-20 18:15:45
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: [plugin] [ORPHAN] rss_auto_excerpt
uli wrote:
Hmm, the more I think about it, the more likely it appears to be, that the custom field variant might even be easier to implement, regarding the changes it’d need to check for whether it’s an old or a new kind of excerpt.
I definitely agree. Custom fields are perfect for the book info, and if it’s too much work to change the existing articles, if_custom_field can provide the right tags for both old and new articles.
If the book info is going to remain inside the body, I think skipparagraphs
is a safer way to go than skiplength
.
<txp:if_article_list>
<h3><txp:permlink><txp:title /></txp:permlink></h3>
<txp:if_custom_field name="published"><!-- it will be empty if it's an existing review -->
<txp:rss_auto_excerpt words="65" overrideexcerpt="1" linktext="Read more" ending="..." striptags="1" />
<txp:else />
<txp:rss_auto_excerpt words="65" skipparagraphs="2" overrideexcerpt="1" linktext="Read more" ending="..." striptags="1" />
</txp:if_custom_field>
</txp:if_article_list>
BattleGoddess
You’d better step in soon or Uli and I will have rebuilt your site before you know it ;)
Last edited by els (2008-06-20 18:17:54)
Offline
#113 2008-06-20 19:34:46
- BattleGoddess
- New Member
- Registered: 2008-06-20
- Posts: 2
Re: [plugin] [ORPHAN] rss_auto_excerpt
uli,
Thanks for noticing the “” quote problem, though I fixed it, it didn’t solve the problem.
However, Els, your idea of placing the book info in the excerpt area, then placing the an <txp:excerpt />
tag in the article form, worked like a charm.
Els wrote:
I understand that you have the book info (publishing date etcetera) inside the article body. Wouldn’t it be simpler to put that in the excerpt field if you’re not using that for something else? Then you’ll just have to add
<txp:excerpt />
to your individual article form, and you don’t need theskipwhatever
attribute in the plugin tag.
Hey, I just noticed you guys mentioned other solutions, such as using a custom field. I will deffinitely look into this other method.
Thank you so much for all your help, I greatly apprecate it.
I’ve been building websites for ten years and am fluent in HTML, Flash and CSS. I must say that Textpattern is an excellent way of building a website and has a very solid support community. (However, I do need to brush up on my XHTML and PHP! LOL)
Offline
#114 2008-06-20 22:20:44
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,311
Re: [plugin] [ORPHAN] rss_auto_excerpt
Els wrote:
You’d better step in soon or Uli and I will have rebuilt your site before you know it ;)
Yeah, there was piracy in the air ;) I can see our logo right before me: A squared eyed skull with crossed band-aid strips underneath ;))
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#115 2008-06-21 04:03:59
- paulyoung
- Member
- Registered: 2008-06-21
- Posts: 10
Re: [plugin] [ORPHAN] rss_auto_excerpt
This plugin is causing my page to be invalid because:
<p>
<txp:rss_auto_excerpt excerpt="body" length="280" linktext="0" overrideexcerpt="1" striptags=“1” stripbreakstabs=“1” wraptag=""/>
</p>
outputs
<p>
This is text from the article body <p />
</p>
and
<txp:rss_auto_excerpt excerpt="body" length="280" linktext="0" overrideexcerpt="1" striptags=“1” stripbreakstabs=“1” wraptag="p"/>
outputs
This is text from the article body
<p />
I’ve also tried adding wraptag=""
to the first example.
Please help.
Last edited by paulyoung (2008-06-21 04:05:24)
Offline
#116 2008-06-21 06:34:16
Re: [plugin] [ORPHAN] rss_auto_excerpt
i see curly quotes in some of your attributes. try getting rid of those first.
also paragraph tags might just be coming from textile.
Last edited by iblastoff (2008-06-21 06:37:04)
Offline
#117 2008-06-21 13:45:22
- paulyoung
- Member
- Registered: 2008-06-21
- Posts: 10
Re: [plugin] [ORPHAN] rss_auto_excerpt
I have removed the curly quotes and it’s still happening.
I thought striptags="1"
would remove any textile tags also but obviously not.
feragnoli wrote:
I can’t manage to wrap the excerpt in a
<span>
rather than in<p>
.
when I setexcerptwraptag="span"
he just spits:<span><p> . . . . . </p></span>
.
jakob wrote
bq. If you wantstriptags="1"
to also strip tags from real excerpts, add the line marked below to the plug-in code just after the if there’s a real excerpt use it bit (around line 34):
// if the article has an excerpt, show it
if ($excerpt != '' && !$overrideexcerpt) {
// add this line here:
$excerpt = ($striptags) ? strip_tags($excerpt) : $excerpt;
This way your authors don’t need to remember to add a space or to switch off textile for the excerpts.
Can I do something like this?:
$body = ($striptags) ? strip_tags($body) : $body;
Last edited by paulyoung (2008-06-21 13:52:34)
Offline
#118 2008-06-21 13:47:06
- paulyoung
- Member
- Registered: 2008-06-21
- Posts: 10
Re: [plugin] [ORPHAN] rss_auto_excerpt
Actually, it appears that this line is already part of the plugin.
Offline
#119 2008-06-21 14:18:54
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,311
Re: [plugin] [ORPHAN] rss_auto_excerpt
paulyoung wrote:
I have removed the curly quotes and it’s still happening.
Have you thought of any kind of caching (local, asy_jpcache etc.)?
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#120 2008-06-21 14:37:13
- paulyoung
- Member
- Registered: 2008-06-21
- Posts: 10
Re: [plugin] [ORPHAN] rss_auto_excerpt
Don’t know what you mean, could you explain?
Offline