Censorship banner.png

Difference between revisions of "Help:RSS"

From Wiki - Hipatia
Jump to: navigation, search
Line 1: Line 1:
===The <nowiki><rss></nowiki> tag===
+
===The <nowiki><rss></nowiki> tag ===
 
The custom tag is called ''<nowiki><rss></nowiki>''. For instance, if you put ''<nowiki><rss>http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/world/rss.xml</rss></nowiki>'' then you will create a feed to BBC World news.  
 
The custom tag is called ''<nowiki><rss></nowiki>''. For instance, if you put ''<nowiki><rss>http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/world/rss.xml</rss></nowiki>'' then you will create a feed to BBC World news.  
  
Line 15: Line 15:
 
:Hides the title (and description in <code>desc=off</code>) of the feed.
 
:Hides the title (and description in <code>desc=off</code>) of the feed.
 
;''text''
 
;''text''
:By default, the reader will display the items as a bullet list of title links, but often the desired format is for each item to contain the description text. Add the "text" parameter to render the items in a div tag of class "rss", for example: <br><code><nowiki><rss text>http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/world/rss.xml</rss></nowiki></code><br>See [[OrganicDesign:Home]] for an example of this format, the CSS rules used in this example are shown in the CSS section below.
+
:By default, the reader will display the items as a bullet list of title links, but often the desired format is for each item to contain the description text. Add the "text" parameter to render the items in a div tag of class "rss", for example: <br><code><nowiki><rss text>http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/world/rss.xml</rss></nowiki></code><br>

Revision as of 18:09, 21 August 2011

The <rss> tag

The custom tag is called <rss>. For instance, if you put <rss>http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/world/rss.xml</rss> then you will create a feed to BBC World news.

multiple feeds
You can add more than one feed in a single <rss> tag to have them display in columns. Do so by adding "|" between the feed urls. Thus, <rss>firsturl|secondurl|thirdurl</rss> will create a reader with 3 columns, displaying items from all 3 feeds. Inside the <rss> tag you can include optional settings, which are detailed below:
number
By default, the reader will display all the items in the feed. If you want to display upto a maximum of a certain number of items, then add number=n (where n is the max number) inside the rss tag:
<rss number=10>http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/world/rss.xml</rss>
will display the last 10 stories from BBC World.
time
By default, the reader will take the value of $egCacheTime as the amount of time (in seconds) between each local caching of the RSS feed. If you want a certain feed to refresh its cache more or less frequently, then add time=t (where t is the refresh time in seconds) inside the rss tag:
<rss time=7200>http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/world/rss.xml</rss>
will refresh the cache of stories from BBC World every 7200 seconds (2 hours).
The max and min time allowed for the time argument is governed by $egCacheTimeMin and $egCacheTimeMax in LocalSettings.php. If the specified time falls outside this range, then it will revert to the default $egCacheTime value.
desc=off
Hides the description provided by the feed.
width
If set to a legal value (between $egWidthMin and $egWidthMax) it turns the RSS section into a floating div, aligned to the right, of the width specified (in pixels)
title=off
Hides the title (and description in desc=off) of the feed.
text
By default, the reader will display the items as a bullet list of title links, but often the desired format is for each item to contain the description text. Add the "text" parameter to render the items in a div tag of class "rss", for example:
<rss text>http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/world/rss.xml</rss>