Documentation:UBC Content Management System/CLF Theme/RSS feed
UBC CMS Codex | |
---|---|
Welcome to the support documentation for the UBC CMS Service. | |
Contents | |
UBC Collab Theme | |
UBC Collab Theme Overview | |
RSS Feeds
You can pull an RSS feed by using the RSS Widget as described in the section: How to embed a news feed from RSS; however, this method will only allow you to place an RSS feed in the widget area of your site and the feed will be visible throughout the entire site (unless it's on the frontpage). This might not be what you want. No worries! You can use the feed shortcode to place an RSS feed exactly where you want it, on any page of your liking. You can either use the Section widget and type the feed shortcode in the Section widget, like so: [feed].
The shortcode has a number of parameter values:
- view=
- list
- rsswidget
- blog
- archive (does need excerpt_length to be set)
- cal or calendar
- events
- listevents
- upcoming (does not work with month parameter on RSS feed)
- timeline
- flickr (Flickr feeds are limited to the latest 20 images http://www.flickr.com/help/website/?search=rss#109651 and the gallery will not show more than 20 images no matter what you set the parameter num to)
- num - number of items that you want to display : num=5 will list the latest 5 items
- url - the url of the feed or site
- target= - sets whether links open up in the same or new window
- '_self' - links open in the same window (default)
- '_blank' - links open up in a new window
- date_format - what the date format should look like default 'M d, Y' - look at PHP Date format for more info
- empty - what it should say if the feed is empty
- excerpt_length - the number of character it should display
- time_zone - a string that is documented here http://php.net/manual/en/timezones.php - we are setting the default timezone with the http://www.php.net/manual/en/function.date-default-timezone-set.php function (shouldn't really need to define this)
- show_author - 'true' or 'false' - false if left out only applies to view = rsswidget
- show_date - 'true', 'updated' or 'false' - false if left out only applies to view = rsswidget - 'updated' mean that the dates are being sorted by updated xml filed as opposed to the published date
- order_by_date - if set to 0, it will use the order given by the rss feed, if set to 1 (also default value), it will try to re-order posts by date.
[feed url="http://www.publicaffairs.ubc.ca"]
See example below:
Specify on which page you would like this feed to be displayed.
Please see the example of the outcome below.
Alternatively, you can place RSS shortcode in the main content area of the page. For example,
Please see the example of the outcome below.
For example, you can do something like the following:
[feed url="http://services.calendar.events.ubc.ca/cgi-bin/rssCache.pl?mode=rss&month=current" view="blog"]
The shortcode above pulls the list of events from UBC Events Calendar and displays the description of the event below the link.
Please see below how this shortcode works on the webpage.
Here is another shortcode example using parameter "list" and the outcome on the webpage:
[feed url="http://services.calendar.events.ubc.ca/cgi-bin/rssCache.pl?mode=rss&month=current" view="list"]
Here is another example of the shortcode being used! [feed url='https://circle.ubc.ca/feed/atom_1.0/2429/42591' view='rsswidget' show_author='true' show_date=updated date_format='l, M d, Y h:i:sA' time_zone="America/Vancouver"]