官术网_书友最值得收藏!

Adding taxonomy vocabulary

Now, let's go ahead and create our taxonomy vocabulary.

If you use the menu at the top and click on Manage | Structure | Taxonomy, you will be taken to the Taxonomy admin page:

Fig 1.8: Taxonomy administration

In Fig 1.8, we can see the layout for adding our vocabulary; we can see that there is already a vocabulary called Tags. This will be sufficient for what we need; however, we want to create a new vocabulary to understand how this is done.

Now, if we click on + Add vocabulary, we are taken to another configuration page, where we have two fields:

Fig 1.9: The Add vocabulary administration page

We have a Name and a Description field to enter; the name is what our vocabulary will be called, and the description will appear underneath. After filling in these fields and saving, we are redirected to a page that allows us to add terms.

There are a few ways to create terms by default. We can either add the term directly on this page, or create the terms as we create the content, which is done using an autocomplete text field that will detect an existing term or allow us to create a new one. For now, however, let's create a term manually, and then we can explore how to add a term within our post.

If we click on + Add term, we are redirected to another page that allows us to add details for this term:

Fig 1.10: Term creation page

What we see on this page is as follows:

  • Name: This is the name of our term
  • Description: This is a description related to the term
  • Relations: This allows us to relate the term to other terms
  • URL alias: This lets us create an SEO-friendly path for the term page; we can automate this later, which we will cover later in the chapter

Once we populate these fields and save them, we will see the same page, but we also see a status message saying we have Created a new term Drupal at the top. We can either continue adding terms or return to the vocabulary page. In Drupal taxonomy is an entity type, and again our vocabulary is a bundle. So, we have the power to add fields to our taxonomy terms. We can add any field to this taxonomy term.

主站蜘蛛池模板: 辉县市| 洪泽县| 东乌| 科技| 青岛市| 平乡县| 禄丰县| 龙口市| 外汇| 吉安市| 汉沽区| 蒙山县| 寻甸| 资阳市| 隆林| 鹤山市| 塘沽区| 二连浩特市| 泾川县| 本溪市| 邮箱| 瓦房店市| 富锦市| 公主岭市| 德兴市| 安溪县| 汉川市| 无为县| 新野县| 科技| 中卫市| 乐山市| 潮安县| 青浦区| 西和县| 永善县| 盐城市| 五峰| 普定县| 九江市| 青龙|