Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#106 2008-04-29 11:28:20

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: [plugin] [ORPHAN] rss_auto_excerpt

  1. The code for your rss_auto_excerpt excerpt please.
  2. The code for the article form might help too
  3. Do you use striptags?

If you use ‘striptags’ then you might have to exclude some tags from being stripped.

You can edit the plug-in code:

$body = ($striptags) ? strip_tags($body, '<h4>') : $body;
  • Check out the PHP documentation about strip_tags
  • strip_tags($body, '<h4>') i.e. excludes h4 from being stripped

For my homepage I am using

<div class="excerpts_home">
<txp:rss_auto_excerpt length="260" linktext="Mehr &hellip;" ending="&hellip;" overrideexcerpt="1" striptags="1" linkwraptag="strong" excerptwraptag="p" />
</div>

Note: excerptwraptag="p" is not working in my example (if you check the source code) but I don’t care. To see the output check out my homepage.


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#107 2008-05-31 13:08:12

WebKat
Member
Registered: 2007-01-16
Posts: 301

Re: [plugin] [ORPHAN] rss_auto_excerpt

This may have been covered already but I’m going on about 4 hours of fitful sleep. Is there a way to make it strip out images only? I use this to display a list of recent posts to my LiveJournal with an excerpt, which works great except when I post a picture in my LJ. The space where I have the list doesn’t have room to fit pictures. Also usually when I post pictures I use LJ’s “cut” tag to place the image behind a link rather than having it display automatically, but obviously this LJ-only tag is not understood by Txp and so I’ll get a big image showing, messing up my layout. In this case I’d like to just have it remove any image tags, but not strip all html… possible?



WebKat

Offline

#108 2008-06-20 08:19:52

BattleGoddess
New Member
Registered: 2008-06-20
Posts: 2

Re: [plugin] [ORPHAN] rss_auto_excerpt

Greetings,

I’m a newbie concerning Textpattern, and I’m slowly working my around it, but I’m having a problem with rss_auto_excerpt. I’m rebuilding our Books in Review area to make it easier for reviewers to post their reviews on our website.

Below is what I use for my article_listing form — excerpts.

<txp:if_article_list>
<h3><txp:permlink><txp:title /></txp:permlink></h3>
<txp:rss_auto_excerpt words="65" skiplength=“500” overrideexcerpt=“1” linktext="Read more" ending="..." striptags=“1” />
</txp:if_article_list>

However, no matter what I “skip”, be it length, words or paragraphs, I can’t skip the first few words (the book info: publishing date, publisher, page count, etc.) to auto excerpt part of the actual review.

The book cover, and info are in tables, so I had to strip the tags to skip the image. But I can’t seem to skip the rest.

Real Example:
Historical Romance Club

I do have TinyMCE version 0.7.4 plugin installed, if that makes any difference.

Any help in this matter is much appreciated.

Thanks.

Offline

#109 2008-06-20 11:16:45

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,316

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,316

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 the skipwhatever 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,316

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

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

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 set excerptwraptag="span" he just spits: <span><p> . . . . . </p></span> .

jakob wrote
bq. If you want striptags="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,316

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

Board footer

Powered by FluxBB