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

The next form allows you to set how many text boxes will be created for this field. Leave the value set to<br />

1 and click the “Save field settings” button. The next form provides you with the option to enter help text, set<br />

the field as required, specify a default value, and define what type of text processing will be enabled for the<br />

author. Choosing Full HTML allows authors to use the full capabilities of the WYSIWYG editor, whereas Basic<br />

HTML restricts the number of available formatting options to just the basics (see Figure 5-30 for the Limited<br />

HTML options). Choose Basic HTML and click the “Save settings” button. The new field is now available<br />

for use. Try creating a new event, and you’ll see the new text area where you can enter driving directions<br />

(see Figure 5-30).<br />

Figure 5-30. The new text area for driving directions<br />

Numeric Fields and Other Field Types<br />

By walking through the various field types listed previously, you can see that there is a pattern and a<br />

common set of parameters for nearly every field type we created. A numeric field is essentially a text field,<br />

but restricted automatically by <strong>Drupal</strong> so that it will only accept numeric characters (0–9). As you expand<br />

on the types of fields that you can create by downloading and enabling contributed Fields modules,<br />

you will find slight variations in the process due to the structure of the fields you are creating. However,<br />

the overall process will be the same. If you haven’t done so, now is the perfect time to browse the list of<br />

Fields modules that are available to extend the capabilities of what is available in <strong>Drupal</strong> 8 core. Visit<br />

http://drupal.org/project/modules, click the Fields item in the “Module categories” filter, and click<br />

Search. When you browse, make sure that you’re focusing on Fields modules that are built for <strong>Drupal</strong> 8, as<br />

many of the capabilities inherent in Fields are now part of <strong>Drupal</strong> core, whereas in previous versions of<br />

<strong>Drupal</strong> you had to download and install CCK to do what we just accomplished using <strong>Drupal</strong> out of the box.<br />

To narrow the list to only <strong>Drupal</strong> 8, select 8.x from the Core compatibility drop down and click the Search button.<br />

69

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

Saved successfully!

Ooh no, something went wrong!