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 20 ■ Building a Company Site<br />

Creating the Footer<br />

The footer will display the Main navigation menu, company address, and contact information. All three<br />

elements will be displayed using blocks via the Block layout. The Main navigation menu block already exists,<br />

as it was created when installing <strong>Drupal</strong> 8. We’ll create a custom block for the company address, create<br />

another block for contact information, and assign all three blocks to the footer region (depending on which<br />

theme you have selected, the actual names of the regions may vary) using the steps outlined in Chapter 10.<br />

After creating the company address and contact information blocks and assigning all three blocks to the<br />

footer, it’s time for a little CSS work to make the blocks appear left to right instead of stacked on top of each<br />

other, and to change a few colors. After the CSS updates, the footer is ready for production (see Figure 20-17).<br />

Figure 20-17. Site footer<br />

Creating the Homepage<br />

The final step in the site-building process is to create the homepage for our corporate site. The homepage<br />

will consist of a simple introductory paragraph that describes the company, a list of the latest blog posts,<br />

latest news items, and the news feed created by the aggregator.<br />

First, visit the “Block layout” page and assign the News: Homepage News block to the Featured First<br />

region, remembering to only show the block on the homepage (by using as the value entered in the<br />

“Show for the listed pages” text area). Assign the Blog: Homepage Blog Posts block to the Featured Second<br />

region, also setting the block visibility to only show on the homepage. Assign the Aggregator feed block to<br />

the Featured Third region, also setting block visibility to only show on the homepage, overriding the default<br />

title to “Latest Business News,” and setting the number of items to display to 5.<br />

The last item to add to the homepage is the introductory paragraph that describes ACME Co. Use a<br />

standard Article as the source of information about ACME. To force the article to appear on the homepage,<br />

check the “Promoted to front page” option in the “Promotion options” section of the Article edit form. The<br />

last step is to update the standard off-the-shelf Frontpage view to display the default view of content instead<br />

of the teaser.<br />

The result of all of the work is a great start to a corporate website, as shown in Figure 20-18.<br />

228

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

Saved successfully!

Ooh no, something went wrong!