Page 1 of 1

How to detect that I'm producing content for the RSS output?

Posted: Tue Dec 20, 2011 12:33 pm
by blog.brockha.us
A plugin of mine changes the article content using the "frontend_display" hook.
I would like to produce some other output, if the content is produced for any RSS. Is there a simple way to detect it?

Do I have to check the GET for having "rss.php"? That would be uncool, if some blog changed this name for any reason. Is there a better way (by checking some field in the eventData i.e.)?

Thanks.

Re: How to detect that I'm producing content for the RSS out

Posted: Tue Dec 20, 2011 3:38 pm
by onli
Hopefully there is a eventdata way.

Have a look at the freetag and the findmore-plugin. Those plugins use frontend_display:html;per_entry and frontend_display:rss-*. You could use those events.

Re: How to detect that I'm producing content for the RSS out

Posted: Wed Dec 21, 2011 9:28 am
by garvinhicking
Hi!

Also, you could check the $addData variable in the eventhook, in most cases this has a "from" signature; I'm not sure if that is vor RSS feeds.

also you can check on $serendipity['view'] that should point to an RSS feed source...

HTH,
Garvin

Re: How to detect that I'm producing content for the RSS out

Posted: Fri Dec 23, 2011 11:38 am
by blog.brockha.us
Thanks to both of you! I'll check this out. :)