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

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.

主站蜘蛛池模板: 昌吉市| 专栏| 兴文县| 綦江县| 若羌县| 苍南县| 韶关市| 渝北区| 游戏| 富裕县| 湖州市| 陈巴尔虎旗| 姚安县| 阜城县| 石楼县| 社旗县| 金川县| 松溪县| 固镇县| 乌兰浩特市| 嘉定区| 汾西县| 泽普县| 黔江区| 南汇区| 资溪县| 河北省| 丽江市| 缙云县| 秀山| 喜德县| 朝阳市| 修文县| 和政县| 双牌县| 阿巴嘎旗| 丰顺县| 拜城县| 于都县| 绵阳市| 澎湖县|