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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 9 ■ Views<br />

list of options, choose Feed. The next step is to enter a URL where the feed will be accessed. In the second<br />

column in the “Feed settings” section, click the “No path is set” link to enter a URL. For demonstration<br />

purposes, I’ll enter a URL of rss/all-articles. I could have used any URL, but I find it easier to prefix all<br />

of my RSS feed URLs with rss so that it is apparent what that URL renders. Complete the process by clicking<br />

the Apply button to save the changes to the URL, and then clicking the Save button at the bottom of the form<br />

to save the updates to the view. You now have an RSS feed that other sites can use to consume articles from<br />

your site. Visiting that URL shows the output of the feed (see Figure 9-10).<br />

Figure 9-10. A Views-generated RSS feed<br />

Creating Tables<br />

Rendering content as lists works well in most cases, but you’ll likely encounter scenarios where listing<br />

content in a table format is more representative of how users prefer to view the content. For demonstration<br />

purposes, return to the Recent Articles view edit form to create a new display that will render fields from<br />

articles in a spreadsheet-like format. Click the Add button in the Displays area, and select Block as the<br />

display type. Change the “Display name” as you did previously, this time to “Table of articles.” Click<br />

“Unformatted list” in the Format section, changing the type of output to be rendered to Table, and remember<br />

to change the For option at the top of the page to “This block (override)” before clicking the “Apply (this<br />

display)” button. The next screen that appears presents the style options that you can set for your new<br />

table(see Figure 9-11).<br />

113

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

Saved successfully!

Ooh no, something went wrong!