Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Add a line to the RSS feed
Hi,
I want to add this
<img src="http://example.com/s/piwik.php?idsite=8&rec=1&action_name=<txp:title />" style="border:0" alt="" />
to the default RSS feed, so that the RSS feed puts this out:
<description>
<![CDATA[
<p>bla bla bla</p>
<img src="http://example.com/s/piwik.php?idsite=8&rec=1&action_name=<txp:title />" style="border:0" alt="" />
]]>
</description>
I guess it has to be placed in rss.php
but I really don’t get along with the code there. Every link or something that looks similar to what I am trying to include is taken apart and recombined to a beautiful — but for me completely incomprehensible — soup of code. :)
Any help on how to accomplish this would be greatly appreciated.
Thank you very much,
Alex
Offline
Re: Add a line to the RSS feed
Check out rah_custom_feed. The plugin allows you to customize feed items’ body content using a rah_feed_body
named form template:
<txp:body />
<img src="<txp:site_url />s/piwik.php?idsite=8&rec=1&action_name=<txp:title />" style="border:0" alt="" />
Last edited by Gocom (2013-10-07 15:03:14)
Offline
Re: Add a line to the RSS feed
Hi Jukka,
using the name rah_feed_body
does nonetheless require to redirect /rss
to /?rah_external_output=body
, right?
Then this is not what I was looking for, because I need to keep the default feed URL (/rss
).
By the way, your plug-in was a big help for me anyway. But it would be just superb if there were no need to redirect the feed to a new URL.
Thank you,
Alex
Last edited by ar (2013-10-07 20:06:07)
Offline
Re: Add a line to the RSS feed
You could try to add
$summary .= parse('<img src="<txp:site_url />s/piwik.php?idsite=8&rec=1&action_name=<txp:title />" style="border:0" alt="" />');
right after the definition of summary
(~line 96) in rss.php
, but I would rather use a redirect.
Offline
Re: Add a line to the RSS feed
ar wrote:
using the name
rah_feed_body
does nonetheless require to redirect/rss
to/?rah_external_output=body
, right?
Nope, that’s a different, unrelated plugin. Rah_custom_feed replaces the feed items’ description field.
Last edited by Gocom (2013-10-07 21:11:27)
Offline
Re: Add a line to the RSS feed
Oleg: Thank you. I didn’t try it yet but I wonder why you would prefer a redirection?
Jukka: If I knew of that plugin before… this is awesome. Thank you very much!
Last edited by ar (2013-10-07 23:57:56)
Offline
Re: Add a line to the RSS feed
ar wrote:
Oleg: Thank you. I didn’t try it yet but I wonder why you would prefer a redirection?
It’s more flexible and easier to maintain/update. But you don’t even need to redirect with rah_custom_feed
, so there is no question.
Offline
Pages: 1