RSS Implementation

We’re currently thinking about the best way to implement RSS on our site.

Currently we have AutoIndexes where we specify the snippet template to use in a drop-down. We were thinking that we would just add another template to this list - a RSS template - which would render the AutoIndex items as XML instead.

However, I think this means that if we had an AutoIndex for “Latest News”, which we wanted to use both as HTML and RSS, we’d have to create two content items specifying a different snippet template for each.

Ideally we’d be able to use one content item as HTML and/or RSS.

Does anyone have any ideas on how best to do this?

We recently had a good RSS discussion here.

I think you’re wanting to publish the same content item twice, which I haven’t done (at least not on purpose). But you could include a single content item as a snippet in slots on two different pages, but specify different snippet templates in each page template, like this:

#slot('sAutoNews' '' '' '' '' 'template=SnAutoRSS')##
#slot('sAutoNews' '' '' '' '' 'template=SnAutoHTML')##

You’d end up with three content items, not one, but this is how I have done it.

There’s no reason for multiple content items in this scenario. You can (and should) publish 2 different templates of the “AutoIndex” item, one that renders HTML (as a page) and one that renders XML (as a “feed”).

As Michael points out, you accomplish this by overriding the snippet template by passing the “template” parameter to the slot. It’s also possible to use Dispatch templates to select the correct snippet. This is how the Community Marketing Solution package does it, but it’s possible with just a simple template override.

Dave

We’re already passing the snippet template because sometimes we want the items displayed with Date&Title, for example, and other times we might just want Title.
And I expect it will be the same for RSS : sometimes people will want Date&Title_RSS and sometimes they’ll want just Title_RSS.

Thanks for your thoughts. I’ll have a think how best we can achieve this.