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

Formatting the Input Form for a Custom Content Type<br />

Sometimes you may find that the visual representation of your new content creation form doesn’t fit with<br />

how you would like it to appear. You may want to change the order of fields on the form, the type of widget<br />

used to create content in a field, or the format of the widget itself. To change how the form is displayed, edit<br />

a content type following the steps you’ve performed previously. Click the “Manage form display” tab at the<br />

top of the page, resulting in the list of fields with their widget types and widget configurations displayed<br />

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

Figure 5-31. The “Manage form display” tab<br />

To rearrange the order of the fields on the form, click and hold the arrows icon next to the field you<br />

wish to move, drag the field to the position where you want it to appear, and release your mouse button. To<br />

change the widget type, simply select a new value from the widget select list, and to change the appearance<br />

of a widget (for example, changing a text area so that it displays more than the default five lines), click the<br />

gear icon in the right column (see Figure 5-31).<br />

As an example, let’s change the text area field for driving directions from the default five lines of text to<br />

ten lines of text. To do so, click the gear icon in the right column of the “Driving directions” field. The form<br />

will expand to display a field where you can change the number of rows as well as enter placeholder text that<br />

will appear in the field until the author begins entering text in that field. Change the number of rows from<br />

5 to 10 and then click the Update button, followed by the Save button. The number of rows displayed when<br />

creating a new event is ten, providing the author more room to enter directions.<br />

70

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

Saved successfully!

Ooh no, something went wrong!