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 5 ■ Content Types<br />

Figure 5-17. Adding a list field<br />

The next step in the process is to provide the values that will appear in the list (see Figure 5-18). On this<br />

screen we have to specify the “Allowed values list,” which is the list of options that will be presented to the<br />

author. <strong>Drupal</strong> requires that options be listed as a “key|label” pair, where key is a value representing which<br />

option that was selected (the key value will be stored in the database), followed by the “pipe” character<br />

(press the Shift key and \ to enter a pipe character), and label is the value that will be displayed on the<br />

screen. In the example in Figure 5-18, I used reserved|Reserved and general|General Admission, resulting<br />

in the values of reserved or general being stored in the database. By setting the “Allowed number of values”<br />

field to “Limited” and “1,” <strong>Drupal</strong> will render this list as radio buttons, as the user is restricted to selecting<br />

a single value. If the number is greater than 1, <strong>Drupal</strong> will render this list as check boxes. After entering the<br />

values, click the “Save field settings” button to continue the process.<br />

60

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

Saved successfully!

Ooh no, something went wrong!