Let's take a look at Taxonomy, which is used to sort articles.
Taxonomy is used as a function to sort articles by category or tag. Drupal's Taxonomy function is not limited to uses such as categories or tags, and the way it is used changes depending on the purpose, whether it is used in a category-like way or a tag-like way.
The idea is that articles can have multiple arbitrary labels, and articles can be searched by label, and it is easy to understand if you think of Taxonomy as a function that allows you to create these labels freely.
To use taxonomy in Drupal
- Create a vocabulary as a parent category.
- Create terms as child categories within the vocabulary you have created.
Using my site as an example
- Create a vocabulary called ‘Article Content’
- Create a term called ‘Drupal Article’ within the ‘Article Content’ vocabulary
- Create a term called ‘Web Article’ within the ‘Article Content’ vocabulary
- Create a term called ‘Mac Article’ within the ‘Article Content’ vocabulary
- Create a term called ‘AWS Article’ within the ‘Article Content’ vocabulary
When you click on the Drupal Article menu item, a list of Drupal articles is displayed.
We will now go through the basic usage and concepts, as this is the basis for sorting articles.
In this article, I would like to summarise some information about the Taxonomy function in Drupal.
Drupal's Taxonomy function is simple but flexible, so it can be used in a variety of ways. One of the most basic uses is as a function for sorting articles into categories.
If you use WordPress, you will probably come across the functions called ‘categories’ and ‘tags’. These categories and tags are functions for sorting articles, but let's think about how they are used.
Categories are used to broadly categorise articles, and then assign them to menus, so that readers can find the articles they want to read by looking for the category of the article they want to read in the menu. Categories have a hierarchy, so they are probably used in the following way.
For example, if you are writing an article introducing a restaurant, it would be something like this.
Examples of how to use categories: Categorising restaurants
|-- Restaurants
| |
| |-- Western food
| | |-- Hamburg steak
| | |-- Steak
| | |-- Bistro
| | |-- Omu-rice
| |
| |-- Chinese food
| | |-- Street Chinese food
| | |-- Chinese set meals
| | |-- Sichuan cuisine
| | |-- Cantonese cuisine
Restaurants > Western-style food > Hamburger steak-like dishes. There are three categories.
The actual article is about hamburgers, but hamburgers are a Western-style dish. Western-style dishes are served in restaurants. The reason for this hierarchy is that if you were to list hamburgers and Szechuan cuisine side by side without any hierarchy, it would be difficult for readers to find the hamburger article they were looking for.
If we can show the reader a path to the hamburger article, it will be easier to find, and this path will be displayed in the menu, etc., with the sorting that most people would associate with it, such as Restaurants > Western food > Hamburg steak.
Categories have a hierarchy, and the administrator carries out the sorting of the hierarchy, and the reader uses the hierarchy path.
Now let's think about tags. Unlike categories, tags do not need to be set up in advance, and new tags can be added as needed each time an article is created. To find articles by tag, the tags are listed in a tag cloud rather than in a menu. Users can then look at articles based on the tags that interest them. The difference between categories and tags is that tags can be set up with any keywords you like, so there is no concept of hierarchy.
If you specify tags when writing an article about the same restaurant, it will look like this.
|-- Restaurants
|-- Western food
|
|-- Hamburg steak
|-- Steak
|-- Bistro
|-- Omu-rice
|
|-- Chinese food
|-- Sichuan cuisine
|-- Cantonese cuisine
The purpose of tags is to provide readers with detailed information by displaying them in the upper hierarchy, and to make it easier for readers to find the articles they are looking for. The problem is that, because there is no concept of a hierarchical structure, tags can become unnecessarily numerous, and this can have the opposite effect of making it harder for readers to find the articles they are looking for.
Drupal's taxonomy does not have the concept of categories or tags for specific purposes, so you can use it as a category or a tag depending on your purpose.
In WordPress, Tags > Hamburger, Categories = Restaurants > Western food > Hamburger
but in Drupal, there is a basic concept of Vocabulary > Term
so you can create a hierarchy of Restaurants = Vocabulary > Western food = Parent term > Hamburger = Child term.
The categories and results are the same as WordPress, but WordPress categories can only be displayed as set. Drupal also requires configuration, but you can also use it separately, such as Western food > Hamburger steak, or use it in a tag-like manner alongside Hamburger steak, Steak, and Bistro.
The categories are basically organised in a hierarchy that is designed to be used as a menu. Generally, WordPress is not designed to be used in a way that changes the menu items for each page. It is possible to use it in this way, but it is quite a complicated process. Drupal has a block layout function, so it is easy to change the menu for each article.
This time, we have omitted the explanation of taxonomy, but by using the elements of taxonomy as the extraction conditions in the view function and filtering by term, you can create pages that are organised according to your objectives by dividing categories into very detailed categories.
As I wrote at the beginning of this article, the role of Drupal taxonomy is that by attaching multiple labels to an article, you can freely call up and use the article by label. This means that you can organise articles freely, call them up freely, and display them freely, rather than just using them in a specific way to summarise articles in general, such as with tags or categories.
Not only taxonomy, but also URL aliases can be set for each article, and by using rules for these aliases, sorting by alias is also possible.
This is a bit of a departure from the taxonomy article, but the interesting thing about Drupal is that by combining multiple functions, you can use the information in a single article in a variety of ways. As we will see later, taxonomy by itself forms a list page. By combining it with other elements, what was a single use for a single taxonomy becomes multiple uses when combined with views, and even more uses when combined with block layouts and aliases.
#C15 Content and Structure.article explains the simple use of taxonomies, which is explained here again.
Using a new taxonomy
- Creating vocabularies
- Creating a term in the vocabulary
You will need to do two things.
The two taxonomies set within the #L02 Lee 101Z 50's article described in #C15 Content and Structure.
- Tags : Life style | Tags=Vocabulary / Life Style=Term
- Article content : Old-Clothes Article.| Article content=Vocabulary / Old-Clothes Article.=Term
It is named as a tag, but it does not have to be called a tag. The term set for this tag is
- Creation
- Life Style
These are the only two terms, and their role is set to determine which of the two themes of this website the article is about. They are only two terms, but their role is important and they are set to be displayed in the list of the whole theme and in the new information on the top page. By creating a new article and specifying either term, the article will always appear in the list of themes and in the new arrivals on the top page when it is published.
The list page specifies the taxonomy as an extraction condition in the view and the term as a filter element from the extraction results. This means that articles with the term Life Style in them will be displayed in /Life Style, which is a list page created by specifying it in the view. This page is used as a menu link.
Apart from this, a taxonomy stand-alone listing page has been created. This page can be found by clicking on the link Tag:Life Style, which appears at the bottom of the article.
The article content is named in vocabulary and the term is set according to the article content.
- Old-Clothes Article.
- Fashion Article.
- Watch Article.
- Photo Article.
It can be used in the view as well as the vocabulary as tags above, but it is currently not necessary, so the page generated for each term is used as a category list. A link is placed in the menu as a category list.
The same list is also displayed by clicking on the link Article Content:Old-Clothes Article. that appears at the bottom of the installed article.
Create vocabularies and terms in Structure > Taxonomy.
+Add vocabulary.
Save the name, description, language selection and language selection for the term.
The vocabulary you created will appear in the taxonomy's vocabulary list.
By default, a list of terms is displayed and if you click Edit vocabulary in the pull-down menu
- List
- Edit
- Manage fields
- Manage form display
- Manage display
- Manage permissions
- Translating taxonomy vocabulary
You can configure the settings for.The fields you set here will be reflected in the actual term you create. The fields allow you to add various elements to the list page generated by the term. I use the default field, Term Description, which has an HTML element that describes the content used as a category list.
Structure > Taxonomy > Manage > Edit article content > Article content
- +Add term.
- Name, Description HTML Element, Related > Upper Term, Revision Info, URL Alias and save.If the name is Old-Clothes Article.
- Related > Higher terms are unspecified and can be hierarchical if required, but only administratively, unlike the
- hierarchical concept on the web.
- The revision log is an administrative note.
- The URL alias is term-xxx by default. The list page is not generated without term- in the view rules, so it is set to term-lifestyle-old_clothes.
This is how the term is set up.
Taxonomy is a label feature that articles can have, so you need to set up your articles to have taxonomies.
Configure the pages to have taxonomy in Site building > Content types. Select the content type you want to configure and add the taxonomy to the field.
For more information, see the following article.
#C15 Content and Structure.
The following is an example of setting up a content type and creating a page with specified content. After setting the taxonomy, the taxonomy field is added to the content type and the designated term is selected in the creation of the article to be published.
The above example has the set term as the actual article and is used for listing after publication.
We have looked briefly at taxonomies in Drupal. This was just an overview, but we hope you have seen that Drupal's taxonomy feature allows you to set labels freely on your articles. In the future, we will consider how to use these labels for your articles.
To summarise this article.
- Taxonomies are labels for sorting articles.
- Set up multiple taxonomies for different purposes.
- To use taxonomies, go to Vocabulary > Configure terms, where terms act as tags or categories
- To use a configured term, the vocabulary must be specified in the field of the content type to be used.
- By having a term in an article, a taxonomy list page is generated and can be used as a category list.
- More flexible listing is possible by using taxonomy as the extraction criteria in the view and vocabulary and terms as filtering criteria.
The list can then be used as a category list.
In the next section, examples of taxonomy use in practice will be explained.
Taxonomy-2
This page provides examples of how taxonomies are used. It explains taxonomies by looking at articles and pages on websites that use them.