cancel
Showing results for 
Search instead for 
Did you mean: 

general rss

novel
Champ in-the-making
Champ in-the-making
Hi,

How can I add general RSS feeds to home page?

I put this in "page.ftl" file but does not work
<span class="ih-rss"> <a href="<@makeurl section=section/>rss.xml"><img src="${url.context}/img/rss_16.png" width="16" height="16" alt="" /></a><a href="<@makeurl section=section/>rss.xml">${msg('home.rss')}</a></span>

Help me please!
1 REPLY 1

ben
Champ in-the-making
Champ in-the-making
Hi,

The important part is building the correct url to show the required collection. If you look at \WEB-INF\templates\rss.xml, you will see that the collection value is set to "section.articles". This means that for the specific section the rss feed is requested on, the contents of the section.articles collection is rendered.

You can pass in the current section dynamically to build the URL using the <@makeurl directive (see UrlDirective.java).  In the example this is populated by the "section" object, available within the request (along with "webSite" and "asset" - see the dev guide - http://wiki.alfresco.com/wiki/Web_Quick_Start_Developer_Guide#The_wiring).

So this example would create a url to the current section requested, and render the section.articles collection for this section:

<a href="<@makeurl section=section/>rss.xml">test</a>

So if for example I was on the home page and wanted to render the section.articles collection from the "news" section, I could use:

<a href="<@makeurl section=section/>news/rss.xml">test</a>

Ben.