RSS feeds

Icons

If your site uses RSS feeds, there are images and styles available for displaying the RSS icon. RSS icons should only be used to indicate RSS feeds.

RSS icons on menus

On the menu a 16x16 px icon may appear within the first heading block, aligned to the right, using the following code:

<a href="#" class="menu-rss">
  <img src="//style.anu.edu.au/_anu/images/share/rss.png" class="w16px right" alt="RSS feed" />
</a>

Within the standard PHP templates, this code should be placed within the <p> tag before the heading, for example:

<p>
  <a href="#" class="menu-rss">
    <img src="//style.anu.edu.au/_anu/images/share/rss.png" class="w16px right" alt="RSS feed" />
  </a>
  <?php echo $SiteShortName ?>
</p>

The icon can only be placed in this position if there is only one feed on the site and the icon links to it, if there is a site-wide feed combining all feeds on the site and the icon links to it, or if it links to a list of all RSS feeds available through the site. Icons cannot be placed on individual menu items and should instead be placed on pages.

RSS icons on pages

On a page, a 32x32 px icon should be aligned to the right of the page heading. The icon can only be placed in this position if it links to a feed that relates to the content on that page (for example, if the heading is Events the RSS feed should be for Events).

The icon can be added using the following code:

<span class="right">
  <a href="#">
    <img src="//style.anu.edu.au/_anu/images/share/rss.png" class="w32px" alt="RSS feed" />
  </a>
</span>
 

Including content from ANU Billboard RSS feeds

What's happening?

RSS feed for Staff NoticesNotices

» more notices

RSS feed for Staff EventsEvents

» more events

You can include content on your website that is automatically drawn from ANU RSS feeds for Billboard or ANU News. The boxes on the right are an example of Billboard feeds. RSS content boxes may be included on any page within your website (not within the menu area).

Some RSS feeds take a few seconds to be returned from their server, which can slow down the time for your page to load in a browser. Make sure you test any RSS feeds that you plan to use, and if you find they are too slow, consider another method of including the RSS information - such as downloading it hourly and caching it locally on your site or in a database.

Installing with PHP templates

If you are using the PHP templates, you can use the files in the 'optional/rss_reader' directory to include content generated from RSS feeds.

  1. Save rss_functions.php and rss_lib.php into the directory of your choice on your web server. These files contain code for parsing the RSS feeds.
  2. Ensure the page you want to display the information on can find the files:
    1. Open rss_example.php and copy include ('rss_functions.php');
    2. Open the php file for the page where you want the content from the RSS feed to appear. Paste the code underneath //CONFIG FILE REFERENCE// include ('config.php');
    3. If you have saved the RSS files from step one into a directory other than the root of your website, you will need to edit the include reference to add that directory, for example: include ('/settings/rss_functions.php');
  3. Set up the URLs of the feeds you want to extract from:
    1. Return to rss_example.php and copy the variables from $rss_url1 to $list3 = output_rss(get_rss($rss_url3,5,true,true));
    2. Return to the page that will display the RSS conntet and paste the code underneath include $Menu;.
    3. Edit the pasted code to change the URLs to retrieve the desired information (pay attention to the area ID for billboard feeds as these correspond to categories) and remove any feeds you don't want (delete both the $rss_url line and the $list lines).
  4. Insert the code needed to display the information on the page:
    1. Return to rss_example.php and copy the code from <div class="box-solid"> to </div>.
    2. Return to the page that will display the RSS content and paste the code within the page content where you want the box to display.
    3. Edit the pasted code to remove any blocks that you don't want to use, and to change the layout or headings if required.
  5. Save your page and preview it to ensure information from the feed displays.

Updated:  18 August 2017/ Responsible Officer:  Director Marketing/ Page Contact:  Webstyle