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 7 ■ Creating Menus<br />

Clicking that link will take you directly to the page we just created, regardless of where you are on<br />

the website.<br />

Adding a Menu Item for an External Page<br />

You can add links to external sites by adding a menu item. To do so, click the Manage link at the top of the<br />

page and the Structure link in the submenu. On the Structure page, click the Menus link. On the Menus<br />

page, click the triangle icon next to the “Edit menu” button for the Main navigation menu and select the<br />

“Add link” option. You should now see the “Add menu link” form (see Figure 7-3). Enter a title (in this<br />

example, I used Apress as the menu title), the link, which is the full URL to the external page to which we<br />

want to link (in the example I used http://apress.com), ensure that the Enabled check box is checked, and<br />

for demonstration purposes, select “Main navigation” from the “Parent link” drop-down list.<br />

Figure 7-3. Adding a menu item for an external page<br />

Once you’ve entered all the values, click the Save button at the bottom of the page (you may need to<br />

scroll down to see it). <strong>Drupal</strong> then displays the complete list of items assigned to the Main navigation menu,<br />

including the new item that we just created.<br />

Navigate back to the homepage of your site by clicking the “Back to site” link in the admin menu. You<br />

should now see the new menu item that you just added. Clicking that menu item will take you to the external<br />

link that you entered when you created the menu item.<br />

Creating a New Menu<br />

There may be situations where you need to create additional menus beyond the standard menus created<br />

and enabled with <strong>Drupal</strong> 8. As an example, when creating <strong>Drupal</strong>-based websites for public libraries, I am<br />

often asked to build unique menus for each department in the library (a menu each for Adult Services, Youth<br />

86

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

Saved successfully!

Ooh no, something went wrong!