please, help me with changes in rss feed

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
SuE
Regular
Posts: 11
Joined: Fri Feb 10, 2006 12:58 pm

please, help me with changes in rss feed

Post by SuE »

hi,
my blog is registerd in an agregator and they asked me that I add description with short text (250 chars) to the feed (category feed). Unfortunately, i dont not know how :cry:
Is it possible?
Could you give me some advice? I am not php programmer

Thanks for any help
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: please, help me with changes in rss feed

Post by garvinhicking »

Are you sure they want that description INSIDE the feed? That is not very usual; maybe they are asking you for a description they just put into their database.

If they absoultely positively want a feed description, please ask them which RSS-Element they exactly want to fetch. Usually the description of your blog (as entered in your serendipity configuration) is used as description for the RSS feed.

Then we can help you :)

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/
SuE
Regular
Posts: 11
Joined: Fri Feb 10, 2006 12:58 pm

Post by SuE »

sorry, it was not clear, my mistake.
As far as I understand it, they want short description to each article - short text (first 250chars) of the article body
My idea was to add it to each feed item before the content but I do not know how to cut the body length
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Serendipity offers a distinction between Entry Body and Extended Entry.

The Entry Body is what is put on the frontpage of your blog and inside the RSS feed.

The extended entry is usually not included in the RSS feed, and only shows up in the article view on your blog.

Thus, you can use the 'Entry Body' as a Teaser, and the extended entry as the main entry.

RSS Feeds have no distinction between a teaser and a fulltext, so you cannot just put a second textblock anyhwere, since it would be included within your main body textblock.

Best 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/
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Garvin, I'm using the Wizz RSS reader extension for Firefox. (I don't know why; I'm still getting accustomed to this RSS stuff.) Many of the sites I have listed will include both a title and a summary, which I see when I hover over the title. Some even place ads in the summary. Most have copies of the first few sentences of the article text.

When I hover over my own titles, I get "No Description".

It's my guess that his aggregator wants him to include this summary. Wikipedia seems to say that it would go in <summary> tags in an Atom feed.
Judebert
---
Website | Wishlist | PayPal
SuE
Regular
Posts: 11
Joined: Fri Feb 10, 2006 12:58 pm

Post by SuE »

hi,
I do not want any changes in the blog, only when rss is generated. I hate the "read more" link so I usually put the whole post on the front page.
Generally, it should look like this:

blog post:

This is blog post very long and about nothing just to show i am able to write because i am well trained monkey and i want to get bananas and watch tv and i know that serendipity is the best blog ever. any banans for me?

feed for categories:

Code: Select all

<item> ....

<description>This is blog post very long and about nothing just to show i am able to write because i am well trained monkey and ... </description>

<content>This is blog post very long and about nothing just to show i am able to write because i am well trained monkey and i want to get bananas and watch tv and i know that serendipity is the best blog ever. any banans for me?
</content>
So what I want is just to "copy" the beginning 250 chars of the post and put them into the description tag. As far as I know this is valid syntax for rss feed 2.0
In fact, most of the blogs in that agregator give only the description and the user must visit the site to get the content. So the agregator uses only the description tag for short preview too
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

You should really split your text up into an extended body then. You can edit your template "entries.tpl" file so that extended and usual body are visible both on all times. Several forum threads deal with that if you search for "entries.tpl body extended", I think.

Best 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/
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Personally, I think we should be able to set the item's feed description separately. For what you want, you could edit the feed_2.0.tpl and add a line like

Code: Select all

<comment>{$entry.feed_body|@escape|@truncate:250:false}</comment>
Beware, though, that multiple people on the forums have seen weird results from the Smarty truncate modifier.
Judebert
---
Website | Wishlist | PayPal
Post Reply