Example - RSS Feed

RSS for third party content

Concrete5 already has an RSS block, but its a bit tired and inflexible. If you want to do more with an RSS feed you either need to get coding for a block template and possibly a controller override, or you can explore the possibilities with Universal Content Puller.

As an RSS feed will be external to the site, the Content Source  to use will again be URL

Basic feed

To investigate the possibilities, we need an RSS feed. NASA is a good source. From those available, the example here uses Breaking News at https://www.nasa.gov/rss/dyn/breaking_news.rss.

The Multi Selector Content Transform can pick out items from XML data.

  • Source content type - XML / XHTML
  • Container css selector - channel
  • Level 1 - item
  • Level 2 - [blank] (for all children) + Return text with attributes, url src type title alt

For display, The Multi Level List Content Display has the flexibility to display the pulled RSS in many ways.

  • Level 1 - Paragraphs + First child value
  • Level 2 - Definition List, horizontal + Capitalised keys + Filter 1 Title Source Enclosure Type Guid Dc:identifier, Source Url.

The filters are to remove elements pulled from the XML that would clutter our display. Definition List, horizontal is a good list type as it shows all the headings (keys), so can help identify what to add to the filter.

As the RSS feed can be long, its an ideal place to explore the pagination capabilities of UCP. Here the pagination is set very low so we don't fill too much of this page.

  • Outer list items to display - 2
  • Paginate - Below
  • Include block identity in pagination - No

By leaving out the block identity in the pagination, all variations of the RSS feed shown on this page will paginate together!

In the Advanced tab, the main settings we need are the Advanced Autolinker and to Render Image URLs as Images. An important point here is that the settings don't change the file size of images, just the maximum size they are displayed.

NASA Awards Total and Spectral Solar Irradiance Sensor-2 Spacecraft Contract

Description
NASA has awarded the Total and Spectral Solar Irradiance Sensor-2 (TSIS-2) Spacecraft contract to General Atomics Electromagnetic Systems Group of San Diego, California.
Enclosure Url
Pubdate
Thu, 02 Jul 2020 11:59 EDT
Source Url
www.nasa.gov/rss/dyn/breaking_news.rss

NASA Names Joel Montalbano International Space Station Program Manager

Description
Kathy Lueders, NASA’s associate administrator for Human Exploration and Operations, has named Joel Montalbano as manager of the International Space Station Program. The appointment was effective June 29 following the June 26 retirement of Kirk Shireman, who held the position since 2015.
Enclosure Url
Pubdate
Tue, 30 Jun 2020 17:45 EDT
Source Url
www.nasa.gov/rss/dyn/breaking_news.rss

View settings

Getting the items in order

By default, the various elements are shown in the sequence they are declared in the XML of the RSS feed. That can be changed by entering a Shuffle sequence for the second list level.

The version below has a Shuffle set to Pubdate, Description, Enclosure Url, Link.

NASA Awards Total and Spectral Solar Irradiance Sensor-2 Spacecraft Contract

Pubdate
Thu, 02 Jul 2020 11:59 EDT
Description
NASA has awarded the Total and Spectral Solar Irradiance Sensor-2 (TSIS-2) Spacecraft contract to General Atomics Electromagnetic Systems Group of San Diego, California.
Enclosure Url

NASA Names Joel Montalbano International Space Station Program Manager

Pubdate
Tue, 30 Jun 2020 17:45 EDT
Description
Kathy Lueders, NASA’s associate administrator for Human Exploration and Operations, has named Joel Montalbano as manager of the International Space Station Program. The appointment was effective June 29 following the June 26 retirement of Kirk Shireman, who held the position since 2015.
Enclosure Url

View settings

Removing the titles

For a variation, the Level 2 list type can be set to Paragraphs + none.

As a side effect, the Level 2 items no longer have headings, so they can only be filtered and shuffled by number. Hence an intermediary step is to set Paragraphs + Number 1,2,3 to see the numbers of the items. Then make a note of the numbers to filter, below these are 1 2 5 8 9 10, then change to Paragraphs + none for the finished list.

Having filtered, the numbers for shuffling are reset to a contguous 1,2,3... Here we need to actually count from the start of our filtered numbers. The publication date is the 4th item and the rest are already in the sequence we want, so simply setting Shuffle to 4 will achieve the desired effect.

NASA Awards Total and Spectral Solar Irradiance Sensor-2 Spacecraft Contract

Thu, 02 Jul 2020 11:59 EDT

NASA has awarded the Total and Spectral Solar Irradiance Sensor-2 (TSIS-2) Spacecraft contract to General Atomics Electromagnetic Systems Group of San Diego, California.

www.nasa.gov/press-release/nasa-awards-total-and-spectral-solar-irradiance-sensor-2-spacecraft-contract

NASA Names Joel Montalbano International Space Station Program Manager

Tue, 30 Jun 2020 17:45 EDT

Kathy Lueders, NASA’s associate administrator for Human Exploration and Operations, has named Joel Montalbano as manager of the International Space Station Program. The appointment was effective June 29 following the June 26 retirement of Kirk Shireman, who held the position since 2015.

www.nasa.gov/press-release/nasa-names-joel-montalbano-international-space-station-program-manager

View settings

Adding Style

We now have a few options for a readable RSS feed where we have complete control over what data is presented and the sequence it is shown.

All that is left is to add a bit of style. Each item in the UCP list is assigned classes based on heading and position in the list, so styles could be added to the theme, or (slightly naughty) declared in an HTML block, or placed in a Header Extra Content attribute as we have done here. 

The styles can be localised to a specific UCP block by adding a unique wrapper class in the Advanced tab of the edit dialog. In this case example-styled.

The Shuffle order has also been revised to 2, 4, 1 to place the image first and then float it to the right.

[code]<style>
.ucp-body.example-styled .ucp-item-2-2{
    font-size:80%; 
    font-style:italic;
} 
.ucp-body.example-styled .ucp-item-2-1{ 
    float:right;
    margin-left:15px; 
} 
.ucp-body.example-styled .ucp-item-2-1 img{
    max-width:200px; 
} 
.ucp-body.example-styled h3{ 
    clear:both; 
} </style>[/code]

NASA Awards Total and Spectral Solar Irradiance Sensor-2 Spacecraft Contract

Thu, 02 Jul 2020 11:59 EDT

NASA has awarded the Total and Spectral Solar Irradiance Sensor-2 (TSIS-2) Spacecraft contract to General Atomics Electromagnetic Systems Group of San Diego, California.

www.nasa.gov/press-release/nasa-awards-total-and-spectral-solar-irradiance-sensor-2-spacecraft-contract

NASA Names Joel Montalbano International Space Station Program Manager

Tue, 30 Jun 2020 17:45 EDT

Kathy Lueders, NASA’s associate administrator for Human Exploration and Operations, has named Joel Montalbano as manager of the International Space Station Program. The appointment was effective June 29 following the June 26 retirement of Kirk Shireman, who held the position since 2015.

www.nasa.gov/press-release/nasa-names-joel-montalbano-international-space-station-program-manager

View settings

Additional Pages

About this Sidebar

Creating a sidebar for a group of pages without messing about with stacks is an easy use-case for Universal Content Puller.

This sidebar is edited once, within the main addon page for Universal Content Puller.

It is then pulled into all UCP sub-pages using a UCP block.

The Content Source is Parent Page, set to pull the Sidebar area from 2 pages from the top. The Content Transform is Selector, set to remove container and row classes that, when unnecessarily nested, could mess up the Bootstrap grid. The Content Display is Plain, which just outputs the transformed text.

In the advanced settings, sanitization is disabled as we trust the source page and don't want to strip out any formatting or functionality from the pulled sidebar.