Conditional Publishing

Hi,

We have page templates for our autoindexes that generate XML, RSS, etc. At the moment these always publish for every autoindex.
Is there a way in which we could have a field on the content-type - “make available as RSS?”, for example - which would only publish the RSS page if that were checked?

Nick.

Have you already checked out Dispatch Templates (p187 Implementation guide)? I’ve not really used them yet, but it looks like it might give you a possible solution.

Yes, you’re right, dispatch templates allow you to choose between templates based upon some criteria.
What we’re looking to do is have the “make available as RSS” checkbox publish an additional template. That’s probably not clear enough in my post. At the moment it always publishes this additional template. It’s not a problem - it works fine - but it seems like we should be able to handle this more cleanly.

I suppose, technically, you could have the dispatch template choose between publishing that RSS template and an “empty” one based on your checkbox (ie. one that always publishes to a hardcoded location with nothing in it… /mysite/empty.tmp) . Yes, I realize that this probably isn’t the solution that you are looking for…

Yes, nice thinking.
I had thought about publishing a blank but hadn’t taken that extra step and thought to have it publish the blank to the same location.
It’s a good enough solution for me. Thanks.

Why not publish these RSS items under a separate Content List in which the query tests for your condition in the “WHERE” clause?

Can you explain how that would work, Chris? How would I specify one template for one content list and another template for a different list?