18.11.2015 Views

Beginning Drupal 8

Todd Tomlinson - Beginning Drupal 8 (The Expert's Voice in Drupal) - 2015

Todd Tomlinson - Beginning Drupal 8 (The Expert's Voice in Drupal) - 2015

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 20 ■ Building a Company Site<br />

Figure 20-7. User profile with new fields<br />

Aggregating External News Feeds<br />

One of the requirements we identified earlier in the chapter is the capability to collect news articles from<br />

external websites and aggregate those articles into lists on the corporate website. The Aggregator module<br />

is part of <strong>Drupal</strong> core and is a great solution. By default, the Aggregator module is disabled and may be<br />

enabled by visiting the Extend page. Click the Extend link in the secondary menu and check the box next to<br />

the Aggregator module. Click the “Save configuration” button to enable the Aggregator module.<br />

The next step is to define from which sources we will pull information. On the Configuration page,<br />

search for and click the “Feed aggregator” link (Web Services section). On the “Feed aggregator” page, click<br />

the “Add feed” button to configure a news feed. For demonstration purposes, we’ll use the Reuters Business<br />

News RSS feed as the source of content for our news feed by entering “Latest Business News” in the Title field<br />

and by copying and pasting the URL from Reuters into the URL field (http://feeds.reuters.com/reuters/<br />

businessNews). Leave the update interval set to 1 hour, which is how often <strong>Drupal</strong> will query Reuters for new<br />

news articles. After saving the news feed, run cron to pull the content from Reuters (Configuration ➤ Cron).<br />

After running cron, return to the Feed aggregator configuration page and click the feed’s title to view the<br />

latest news (see Figure 20-8).<br />

218

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!