field_ui.add_field.html.twig

Same filename in other branches
  1. 9 core/modules/help_topics/help_topics/field_ui.add_field.html.twig
  2. 10 core/modules/field_ui/help_topics/field_ui.add_field.html.twig
  3. 11.x core/modules/field_ui/help_topics/field_ui.add_field.html.twig
---
label: 'Adding a field to an entity sub-type'
related:
  - core.content_structure
  - field_ui.manage_display
  - field_ui.manage_form
---
{% set content_types = render_var(url('entity.node_type.collection')) %}
{% set content_structure = render_var(url('help.help_topic', {'id': 'core.content_structure'})) %}
<h2>{% trans %}Goal{% endtrans %}</h2>
<p>{% trans %}Add a field to an entity sub-type; see <a href="{{ content_structure }}">Managing content structure</a> for an overview of entity types and sub-types.{% endtrans %}</p>
<h2>{% trans %}Steps{% endtrans %}</h2>
<ol>
  <li>{% trans %}Navigate to the page for managing the entity sub-type you want to add the field to. For example, to add a field to a content type, in the <em>Manage</em> administrative menu, navigate to <em>Structure</em> &gt; <a href="{{ content_types }}"><em>Content types</em></a>.{% endtrans %}</li>
  <li>{% trans %}Find the particular sub-type that you want to add the field to, and click <em>Manage fields</em>.{% endtrans %}</li>
  <li>{% trans %}Click <em>Add field</em>.{% endtrans %}</li>
  <li>{% trans %}In <em>Add a new field</em>, select the type of field you want to add; see <a href="{{ content_structure }}">Managing content structure</a> for an overview of field types.{% endtrans %}</li>
  <li>{% trans %}The <em>Label</em> field should now be visible; enter a label for the field, which is used as the field label for both content editing and content display.{% endtrans %}</li>
  <li>{% trans %}Click <em>Save and continue</em>.{% endtrans %}</li>
  <li>{% trans %}On the next screen, enter a value for <em>Allowed number of values</em>. You can limit the field to one value per entity item, a set number of values, or set it to have unlimited values. Click <em>Save field settings</em>.{% endtrans %}</li>
  <li>{% trans %}On the next screen, optionally edit the settings for the field, which vary depending on what field type you are creating. For all fields, you can edit the <em>Label</em>, <em>Help text</em> (text to be displayed below the field on the content editing page), and <em>Required field</em> (to make it so a value must be entered in order to save the content when editing). You can also configure a default value for the field.{% endtrans %}</li>
  <li>{% trans %}Click <em>Save settings</em>. You should be returned to the <em>Manage fields</em> page, with your new field in the list.{% endtrans %}</li>
</ol>

File

core/modules/help_topics/help_topics/field_ui.add_field.html.twig

View source
  1. ---
  2. label: 'Adding a field to an entity sub-type'
  3. related:
  4. - core.content_structure
  5. - field_ui.manage_display
  6. - field_ui.manage_form
  7. ---
  8. {% set content_types = render_var(url('entity.node_type.collection')) %}
  9. {% set content_structure = render_var(url('help.help_topic', {'id': 'core.content_structure'})) %}
  10. <h2>{% trans %}Goal{% endtrans %}</h2>
  11. <p>{% trans %}Add a field to an entity sub-type; see <a href="{{ content_structure }}">Managing content structure</a> for an overview of entity types and sub-types.{% endtrans %}</p>
  12. <h2>{% trans %}Steps{% endtrans %}</h2>
  13. <ol>
  14. <li>{% trans %}Navigate to the page for managing the entity sub-type you want to add the field to. For example, to add a field to a content type, in the <em>Manage</em> administrative menu, navigate to <em>Structure</em> &gt; <a href="{{ content_types }}"><em>Content types</em></a>.{% endtrans %}</li>
  15. <li>{% trans %}Find the particular sub-type that you want to add the field to, and click <em>Manage fields</em>.{% endtrans %}</li>
  16. <li>{% trans %}Click <em>Add field</em>.{% endtrans %}</li>
  17. <li>{% trans %}In <em>Add a new field</em>, select the type of field you want to add; see <a href="{{ content_structure }}">Managing content structure</a> for an overview of field types.{% endtrans %}</li>
  18. <li>{% trans %}The <em>Label</em> field should now be visible; enter a label for the field, which is used as the field label for both content editing and content display.{% endtrans %}</li>
  19. <li>{% trans %}Click <em>Save and continue</em>.{% endtrans %}</li>
  20. <li>{% trans %}On the next screen, enter a value for <em>Allowed number of values</em>. You can limit the field to one value per entity item, a set number of values, or set it to have unlimited values. Click <em>Save field settings</em>.{% endtrans %}</li>
  21. <li>{% trans %}On the next screen, optionally edit the settings for the field, which vary depending on what field type you are creating. For all fields, you can edit the <em>Label</em>, <em>Help text</em> (text to be displayed below the field on the content editing page), and <em>Required field</em> (to make it so a value must be entered in order to save the content when editing). You can also configure a default value for the field.{% endtrans %}</li>
  22. <li>{% trans %}Click <em>Save settings</em>. You should be returned to the <em>Manage fields</em> page, with your new field in the list.{% endtrans %}</li>
  23. </ol>

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.