diff options
authorAlex Pott2015-02-16 23:24:30 (GMT)
committerAlex Pott2015-02-16 23:24:30 (GMT)
commit62afca1f894b69a0b38b393d924202115ff64fad (patch)
parent157df3f7ac20b6ab8525fc4e4c0dc21d07456510 (diff)
Issue #2091367 by Shreya Shetty, mparker17, Sree, chintan4u, jhodgdon, ifrik, rteijeiro, rpayanm: Update hook_help for Taxonomy module
1 files changed, 29 insertions, 20 deletions
diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module
index dce8523..c247d14 100644
--- a/core/modules/taxonomy/taxonomy.module
+++ b/core/modules/taxonomy/taxonomy.module
@@ -50,30 +50,39 @@ const TAXONOMY_HIERARCHY_MULTIPLE = 2;
function taxonomy_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case '':
+ $field_ui_url = \Drupal::moduleHandler()->moduleExists('field_ui') ? \Drupal::url('', array('name' => 'field_ui')) : '#';
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
- $output .= '<p>' . t('The Taxonomy module allows you to classify the content of your website. To classify content, you define <em>vocabularies</em> that contain related <em>terms</em>, and then assign the vocabularies to content types. For more information, see the online handbook entry for the <a href="@taxonomy">Taxonomy module</a>.', array('@taxonomy' => '')) . '</p>';
+ $output .= '<p>' . t('The Taxonomy module allows users who have permission to create and edit content to categorize (tag) content of that type. Users who have the <em>Administer vocabularies and terms</em> <a href="!permissions" title="Taxonomy module permissions">permission</a> can add <em>vocabularies</em> that contain a set of related <em>terms</em>. The terms in a vocabulary can either be pre-set by an administrator or built gradually as content is added and edited. Terms may be organized hierarchically if desired.', array('!permissions' => \Drupal::url('user.admin_permissions', array(), array('fragment' => 'module-taxonomy')))) . '</p>';
+ $output .= '<p>' . t('For more information, see the <a href="!taxonomy">online documentation for the Taxonomy module</a>.', array('!taxonomy' => '')) . '</p>';
$output .= '<h3>' . t('Uses') . '</h3>';
$output .= '<dl>';
- $output .= '<dt>' . t('Creating vocabularies') . '</dt>';
- $output .= '<dd>' . t('Users with sufficient <a href="@perm">permissions</a> can create <em>vocabularies</em> and <em>terms</em> through the <a href="@taxo">Taxonomy page</a>. The page listing the terms provides a drag-and-drop interface for controlling the order of the terms and sub-terms within a vocabulary, in a hierarchical fashion. A <em>controlled vocabulary</em> classifying music by genre with terms and sub-terms could look as follows:', array('@taxo' => \Drupal::url('entity.taxonomy_vocabulary.collection'), '@perm' => \Drupal::url('user.admin_permissions', [], array('fragment'=>'module-taxonomy'))));
- $output .= '<ul><li>' . t('<em>vocabulary</em>: Music') . '</li>';
- $output .= '<ul><li>' . t('<em>term</em>: Jazz') . '</li>';
- $output .= '<ul><li>' . t('<em>sub-term</em>: Swing') . '</li>';
- $output .= '<li>' . t('<em>sub-term</em>: Fusion') . '</li></ul></ul>';
- $output .= '<ul><li>' . t('<em>term</em>: Rock') . '</li>';
- $output .= '<ul><li>' . t('<em>sub-term</em>: Country rock') . '</li>';
- $output .= '<li>' . t('<em>sub-term</em>: Hard rock') . '</li></ul></ul></ul>';
- $output .= t('You can assign a sub-term to multiple parent terms. For example, <em>fusion</em> can be assigned to both <em>rock</em> and <em>jazz</em>.') . '</dd>';
- $output .= '<dd>' . t('Terms in a <em>free-tagging vocabulary</em> can be built gradually as you create or edit content. This is often done used for blogs or photo management applications.') . '</dd>';
- $output .= '<dt>' . t('Assigning vocabularies to content types') . '</dt>';
- $output .= '<dd>' . t('Before you can use a new vocabulary to classify your content, a new Taxonomy term field must be added to a <a href="@ctedit">content type</a> on its <em>manage fields</em> page. When adding a taxonomy field, you choose a <em>widget</em> to use to enter the taxonomy information on the content editing page: a select list, checkboxes, radio buttons, or an auto-complete field (to build a free-tagging vocabulary). After choosing the field type and widget, on the subsequent <em>field settings</em> page you can choose the desired vocabulary, whether one or multiple terms can be chosen from the vocabulary, and other settings. The same vocabulary can be added to multiple content types, by using the "Re-use existing field" section on the manage fields page.', array('@ctedit' => \Drupal::url('entity.node_type.collection'))) . '</dd>';
- $output .= '<dt>' . t('Classifying content') . '</dt>';
- $output .= '<dd>' . t('After the vocabulary is assigned to the content type, you can start classifying content. The field with terms will appear on the content editing screen when you edit or <a href="@addnode">add new content</a>.', array('@addnode' => \Drupal::url('node.add_page'))) . '</dd>';
- $output .= '<dt>' . t('Viewing listings') . '</dt>';
- $output .= '<dd>' . t("Each taxonomy term automatically provides a page listing content that has its classification. For example, if the taxonomy term <em>country rock</em> has the ID 123 (you can see this by looking at the URL when hovering on the linked term, which you can click to navigate to the listing page), then you will find this list at the path <em>taxonomy/term/123</em>.") . '</dd>';
- $output .= '<dt>' . t('Extending Taxonomy module') . '</dt>';
- $output .= '<dd>' . t('There are <a href="@taxcontrib">many contributed modules</a> that extend the behavior of the Taxonomy module for both display and organization of terms.', array('@taxcontrib' => ''));
+ $output .= '<dt>' . t('Managing vocabularies') . '</dt>';
+ $output .= '<dd>' . t('Users who have the <em>Administer vocabularies and terms</em> permission can add and edit vocabularies from the <a href="!taxonomy_admin">Taxonomy administration page</a>. Vocabularies can be deleted from their <em>Edit vocabulary</em> page. Users with the <em>Taxonomy term: Administer fields</em> permission may add additional fields for terms in that vocabulary using the <a href="!field_ui">Field UI module</a>.' , array('!taxonomy_admin' => \Drupal::url('entity.taxonomy_vocabulary.collection'), '!field_ui' => $field_ui_url)) . '</dd>';
+ $output .= '<dt>' . t('Managing terms') . '</dt>';
+ $output .= '<dd>' . t('Users who have the <em>Administer vocabularies and terms</em> permission or the <em>Edit terms</em> permission for a particular vocabulary can add, edit, and organize the terms in a vocabulary from a vocabulary\'s term listing page, which can be accessed by going to the <a href="!taxonomy_admin">Taxonomy administration page</a> and clicking <em>List terms</em> in the <em>Operations</em> column. Users must have the <em>Administer vocabularies and terms</em> permission or the <em>Delete terms</em> permission for a particular vocabulary to delete terms.' , array('!taxonomy_admin' => \Drupal::url('entity.taxonomy_vocabulary.collection'))) . ' </dd>';
+ $output .= '<dt>' . t('Classifying entity content') . '</dt>';
+ $output .= '<dd>' . t('A user with the <em>Administer fields</em> permission for a certain entity type may add reference fields to the entity, which will allow entities to be classified using taxonomy terms. See the <a href="!field">Field module help</a> and the <a href="!field_ui">Field UI help</a> pages for general information on fields and how to create and manage them. The reference field can either be a <em>Term reference</em> or an <em>Entity reference</em> field:' , array('!field_ui' => $field_ui_url, '!field' => \Drupal::url('', array('name' => 'field'))));
+ $output .= '<ul>';
+ $output .= '<li>' . t('A <em>Term Reference</em> field corresponds to <em>one</em> vocabulary.') . '</li>';
+ $output .= '<li>' . t('An <em>Entity Reference</em> field can reference <em>several</em> vocabularies at the same time, and it has more configuration options than a Term Reference field.') . '</li>';
+ $output .= '</ul>';
+ $output .= '</dd>';
+ $output .= '<dt>' . t('Adding new terms during content creation') . '</dt>';
+ $output .= '<dd>' . t('Allowing users to add new terms gradually builds a vocabulary as content is added and edited. Users can add new terms if the <em>Autocomplete term widget (tagging)</em> is chosen for a <em>Term reference</em> field, or if either of the two <em>Autocomplete</em> widgets is chosen for an <em>Entity reference</em> field. In this case you need to enable the <em>Create referenced entity</em> option, and restrict the field to one vocabulary.') . '</dd>';
+ $output .= '<dt>' . t('Configuring displays and form displays ') . '</dt>';
+ $output .= '<dd>' . t('The reference fields have several formatters and widgets available on the Manage display and Manage form display pages, respectively:');
+ $output .= '<ul>';
+ $output .= '<li>' . t('The <em>Check boxes/radio buttons</em> widget displays the existing terms of the vocabulary as check boxes or radio buttons based on the <em>Allowed number of values</em> set for the field.') . '</li>';
+ $output .= '<li>' . t('The <em>Select list</em> widget displays the existing terms in a drop-down list or scrolling list box based on the <em>Allowed number of values</em> set for the field.') . '</li>';
+ $output .= '<li>' . t('The <em>Autocomplete term widget (tagging)</em> widget of a <em>Term reference</em> field displays a text field in which users can type a comma-separated list of terms.') . '</li>';
+ $output .= '<li>' . t('The <em>Autocomplete</em> widget of an <em>Entity Reference</em> field displays text fields in which users can type terms based on the <em>Allowed number of values</em>. The display of matching terms can include all terms that contain the typed characters or restricted to those starting with them.') . '</li>';
+ $output .= '<li>' . t('The <em>Autocomplete (Tags style)</em> widget of an <em>Entity Reference</em> field displays a multi-text field in which users can type in a comma-separated list of terms.') . '</li>';
+ $output .= '<li>' . t('The <em>Plain text</em> formatter displays only the name of the term.') . '</li>';
+ $output .= '<li>' . t('The <em>Link</em> formatter displays the name of the term linked to a page that lists all <a href="!node">Node module</a> content items that have been classified with that term.', array('!node' => \Drupal::url('', array('name' => 'node')))) . '</li>';
+ $output .= '<li>' . t('The <em>RSS category</em> formatter displays nothing when the entity item is displayed as HTML, but displays an RSS category instead of a list when the entity item is displayed in an RSS feed.') . '</li>';
+ $output .= '</ul>';
+ $output .= '</dd>';
$output .= '</dl>';
return $output;