Single feed, multiple categories possible?

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Don Chambers
Regular
Posts: 3659
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Single feed, multiple categories possible?

Post by Don Chambers »

As the title suggests, I wanted to know if it is possible for s9y to provide a single feed containing the entries from more than a single category... is this possible?
=Don=
Don Chambers
Regular
Posts: 3659
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Also - can I pick up a specific feed format (ie atom, opml, rss1) for a specific category? Right now, a category feed seems to default to rss2.
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

You should be able to get this via:

rss.php?serendipity[category]=A;B;C;D

replace those letters with the category IDs you want to combine.

And you can use

rss.php?version=2.0
rss.php?version=atom1.0

etc. to determine the format. I've documented all those variables for the german book, let's see if we can get an english translation soon :)

Note that those variables will not work when appended to "prettty URLs". You will need to use the rss.php URL for all of them to work.

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/
Don Chambers
Regular
Posts: 3659
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Thanks Garvin - now how do I combine them on www.example.com for categories 3 and 8 getting an atom 1 feed?
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

rss.php?serendipity[categories]=3;8&version=atom1.0

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/
Don Chambers
Regular
Posts: 3659
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

garvinhicking wrote:Hi!

rss.php?serendipity[categories]=3;8&version=atom1.0

Regards,
Garvin
thanks Garvin - one small typo in your suggestion.. it should be [category], not [categories], just like your original response, and use & for xhtml compliance.

But thanks for the syntax!

This should work on sites with URL rewriting... I just need to use the php?, correct?

EDIT: the & bit does not work... I thought it would. Any idea why it does not?
Last edited by Don Chambers on Sun Apr 13, 2008 12:14 am, edited 2 times in total.
=Don=
Don Chambers
Regular
Posts: 3659
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Garvin - would it be possible for the syndication plugin's option to included extended body be modified to allow that decision on a feed by feed basis?

What I want to do is provide the extended body in only one of the feeds.... most likely, the rss1 feed since nearly any service, such as feedburner, google, etc, are most certainly looking at rss2.... that would allow me to use the the rss1 feed to get body + extended from one of my sites, and aggregate it to another one of my sites while still only showing most readers the entry body only on all other feed formats.

Also, what is the difference between:

{$entry.feed_body|@escape} and {$entry.body} and the difference between {$entry.feed_ext|@escape} {$entry.extended} (other than being escaped)???
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

& is only valid in HTML, not in URLs themselves.
Don Chambers wrote:Garvin - would it be possible for the syndication plugin's option to included extended body be modified to allow that decision on a feed by feed basis?
Yes, you can edit your .tpl template files and there include entry.extended where you want it. Then make sure the syndication plugin does not have the 'Include Extended Body' option checked, because that will operate on entry.feed_body which works for all feeds.
{$entry.feed_body|@escape} and {$entry.body} and the difference between {$entry.feed_ext|@escape} {$entry.extended} (other than being escaped)???
feed_body includes body+extended depending on what the user configured for the plugin, body only the body, feed_ext contains the "Continue reading" line, .extended the extended body.

@escape simply makes sure that a var can be used within XML.

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/
Post Reply