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 />

display that lists only the latest five news article titles and publish dates. Use this block on the homepage.<br />

After creating the view, the output of our News page is as shown in Figure 20-16.<br />

Figure 20-16. The News page<br />

The Staff Blog Page<br />

One of the requirements is that staff should have the capability to blog. When we created the Article Type<br />

taxonomy vocabulary, we included a term named Blog Post. That term is available on the Article content<br />

type, which is the template that we’ll use for staff to blog. Each staff will have the ability to log onto the site<br />

and author Article content, selecting Blog Post from the Article Type. Go ahead and author a few blog posts<br />

so that you can create and test a view to display Blogs.<br />

Follow the same pattern for Blogs as we used for News, a page displaying all blog posts as well as a block<br />

for displaying the latest blog posts on the homepage. Set the Path for the Page display to “blogs” and add the<br />

view to the Main navigation menu. Also create a Block display that lists the latest five blog posts, showing<br />

only the title and the date the blog post was posted.<br />

Adding the Contact Form to the Main Menu<br />

The next step is to add the contact form to the Main navigation menu (Structure ➤ Menus ➤ Main<br />

navigation). Edit the menu, click the “Add link” button, and add a new menu item with a “Menu link title”<br />

of “Contact Us” and a Path of “contact.” Refer to Chapter 7 for more information about managing menus.<br />

227

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

Saved successfully!

Ooh no, something went wrong!