RSS - subject and just a few words

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
CharlesP

RSS - subject and just a few words

Post by CharlesP »

Is there some way to configure RSS to include only the subject and n number of words from the blog?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: RSS - subject and just a few words

Post by garvinhicking »

The RSS feed usually includes the whole "Body" part of your blog posting. So you could move everything else into the "Extended" section of your entries if you don't want the body to show in your RSS feed.

You could then edit the "entries.tpl" template if you want to show your "Extended" Body in the usual Blog all the time.

A second way is to use Serendipity 1.0 snapshots, where you can use Smarty templating for all RSS feeds. There you can use a code like "{$entry.body|truncate:0:255}" for showing the entry!

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Olger
Regular
Posts: 6
Joined: Thu Aug 25, 2005 11:33 pm
Location: Haarlem, The Netherlands
Contact:

Post by Olger »

...or publish your feed through Feedburner, thats what i did after getting very confused on this forum at first ;) http://www.feedburner.com. Just offer the feed though an html nugget. (you can than keep an eye on the amount of subscribers as well). Works for me.
Hokey
Regular
Posts: 141
Joined: Wed Dec 14, 2005 3:36 pm
Location: Germany
Contact:

Post by Hokey »

Hi Garvin!

Could you tell me how to realize this Smarty-solution?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi hokey!

Sure. Edit your feed*.tpl template file. Replace "{$entry.body}" with "{$entry.body|truncate:255:'...'}". Save the template file. You're finished, and now will only see the first 255 characters of your entry body in the RSS feed(s).

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Hokey
Regular
Posts: 141
Joined: Wed Dec 14, 2005 3:36 pm
Location: Germany
Contact:

Post by Hokey »

Thank you Garvin! :D
Post Reply