function field_ui_help

Same name in other branches
  1. 7.x modules/field_ui/field_ui.module \field_ui_help()
  2. 9 core/modules/field_ui/field_ui.module \field_ui_help()
  3. 8.9.x core/modules/field_ui/field_ui.module \field_ui_help()
  4. 11.x core/modules/field_ui/field_ui.module \field_ui_help()

Implements hook_help().

File

core/modules/field_ui/field_ui.module, line 24

Code

function field_ui_help($route_name, RouteMatchInterface $route_match) {
    switch ($route_name) {
        case 'help.page.field_ui':
            $output = '';
            $output .= '<h2>' . t('About') . '</h2>';
            $output .= '<p>' . t('The Field UI module provides an administrative user interface (UI) for managing and displaying fields. Fields can be attached to most content entity sub-types. Different field types, widgets, and formatters are provided by the modules installed on your site, and managed by the Field module. For background information and terminology related to fields and entities, see the <a href=":field">Field module help page</a>. For more information about the Field UI, see the <a href=":field_ui_docs">online documentation for the Field UI module</a>.', [
                ':field' => Url::fromRoute('help.page', [
                    'name' => 'field',
                ])->toString(),
                ':field_ui_docs' => 'https://www.drupal.org/docs/8/core/modules/field-ui',
            ]) . '</p>';
            $output .= '<h2>' . t('Uses') . '</h2>';
            $output .= '<dl>';
            $output .= '<dt>' . t('Creating a field') . '</dt>';
            $output .= '<dd>' . t('On the <em>Manage fields</em> page for your entity type or sub-type, you can add, configure, and delete fields for that entity type or sub-type. Each field has a <em>machine name</em>, which is used internally to identify the field and must be unique across an entity type; once a field is created, you cannot change the machine name. Most fields have two types of settings. The field-level settings depend on the field type, and affect how the data in the field is stored. Once they are set, they can no longer be changed; examples include how many data values are allowed for the field and where files are stored. The sub-type-level settings are specific to each entity sub-type the field is used on, and they can be changed later; examples include the field label, help text, default value, and whether the field is required or not. You can return to these settings by choosing the <em>Edit</em> link for the field from the <em>Manage fields</em> page.');
            $output .= '<dt>' . t('Re-using fields') . '</dt>';
            $output .= '<dd>' . t('Once you have created a field, you can use it again in other sub-types of the same entity type. For instance, if you create a field for the article content type, you can also use it for the page content type, but you cannot use it for content blocks or taxonomy terms. If there are fields available for re-use, after clicking <em>Add field</em> from the <em>Manage fields</em> page, you will see a list of available fields for re-use. After selecting a field for re-use, you can configure the sub-type-level settings.') . '</dd>';
            $output .= '<dt>' . t('Configuring field editing') . '</dt>';
            $output .= '<dd>' . t('On the <em>Manage form display</em> page of your entity type or sub-type, you can configure how the field data is edited by default and in each form mode. If your entity type has multiple form modes (on most sites, most entities do not), you can toggle between the form modes at the top of the page, and you can toggle whether each form mode uses the default settings or custom settings in the <em>Custom display settings</em> section. For each field in each form mode, you can select the widget to use for editing; some widgets have additional configuration options, such as the size for a text field, and these can be edited using the Edit button (which looks like a wheel). You can also change the order of the fields on the form. You can exclude a field from a form by choosing <em>Hidden</em> from the widget drop-down list, or by dragging it into the <em>Disabled</em> section.') . '</dd>';
            $output .= '<dt>' . t('Configuring field display') . '</dt>';
            $output .= '<dd>' . t('On the <em>Manage display</em> page of your entity type or sub-type, you can configure how each field is displayed by default and in each view mode. If your entity type has multiple view modes, you can toggle between the view modes at the top of the page, and you can toggle whether each view mode uses the default settings or custom settings in the <em>Custom display settings</em> section. For each field in each view mode, you can choose whether and how to display the label of the field from the <em>Label</em> drop-down list. You can also select the formatter to use for display; some formatters have configuration options, which you can edit using the Edit button (which looks like a wheel). You can also change the display order of fields. You can exclude a field from a specific view mode by choosing <em>Hidden</em> from the formatter drop-down list, or by dragging it into the <em>Disabled</em> section.') . '</dd>';
            $output .= '<dt>' . t('Configuring view and form modes') . '</dt>';
            $output .= '<dd>' . t('You can add, edit, and delete view modes for entities on the <a href=":view_modes">View modes page</a>, and you can add, edit, and delete form modes for entities on the <a href=":form_modes">Form modes page</a>. Once you have defined a view mode or form mode for an entity type, it will be available on the Manage display or Manage form display page for each sub-type of that entity.', [
                ':view_modes' => Url::fromRoute('entity.entity_view_mode.collection')->toString(),
                ':form_modes' => Url::fromRoute('entity.entity_form_mode.collection')->toString(),
            ]) . '</dd>';
            $output .= '<dt>' . t('Listing fields') . '</dt>';
            $output .= '<dd>' . t('There are two reports available that list the fields defined on your site. The <a href=":entity-list" title="Entities field list report">Entities</a> report lists all your fields, showing the field machine names, types, and the entity types or sub-types they are used on (each sub-type links to the Manage fields page). If the <a href=":views">Views</a> and <a href=":views-ui">Views UI</a> modules are installed, the <a href=":views-list" title="Used in views field list report">Used in views</a> report lists each field that is used in a view, with a link to edit that view.', [
                ':entity-list' => Url::fromRoute('entity.field_storage_config.collection')->toString(),
                ':views-list' => \Drupal::moduleHandler()->moduleExists('views_ui') ? Url::fromRoute('views_ui.reports_fields')->toString() : '#',
                ':views' => \Drupal::moduleHandler()->moduleExists('views') ? Url::fromRoute('help.page', [
                    'name' => 'views',
                ])->toString() : '#',
                ':views-ui' => \Drupal::moduleHandler()->moduleExists('views_ui') ? Url::fromRoute('help.page', [
                    'name' => 'views_ui',
                ])->toString() : '#',
            ]) . '</dd>';
            $output .= '</dl>';
            return $output;
        case 'entity.field_storage_config.collection':
            return '<p>' . t('This list shows all fields currently in use for easy reference.') . '</p>';
    }
}

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