Hướng dẫn sử dụng Hierarchical Select với Drupal 7 Taxonomy

Hướng dẫn sử dụng Hierarchical Select với Drupal 7 Taxonomy

One of our members wanted to create a taxonomy of Countries, Provinces and Districts.

For example, you might choose England, then Yorkshire, then Leeds. Or you might choose Canada, then Ontario, then Toronto. You get the idea.

In this tutorial, we'll use the Hierarchical Select module to make that happen.

Step #1. Get set up

First, you need to set up your taxonomy. I've a simple example here with Countries and Cities, but you'll probably add a lot more terms.

media_1407964548074.png

Next, install and enable Hierarchical Select: https://www.drupal.org/project/hierarchical_select

Make sure to enable "Hierarchical Select Taxonomy":

media_1407964492896.png

Step #2. Create the field

  • Go to Structure > Content types > Manage fields.
  • Create a new field. Choose "Term Reference" and then "Hierarchical Select":

media_1407964599338.png

  • Save the field.
  • Click the "Hierarchical Select" link.

media_1407964692305.png

You'll now see a series of options for the field:

  • Save lineage: Save all term levels (City and Country) or just the one the user chooses.
  • Level choice: What level can a user choose from? Only City? Other other levels too?

media_1407965480092.png

Under "Level labels" you can give labels to the different levels of the taxonomy:

media_1407965646947.png

Under "Dropbox settings", you can decide how many choices a user can make:

media_1407965687740.png

And under "Editability settings", you can decide whether the user can add new terms and levels to our set-up:

media_1407965782913.png

Step #3. Use the field

Finally, click "Add content" and use your field. Here's how the top level will look:

media_1407964776177.png

And, once the first level has been selected, here's how the second level will look:

media_1407964831158.png

 

Bạn thấy bài viết này như thế nào?: 
No votes yet
Ảnh của Tommy Tran

Tommy owner Express Magazine

Drupal Developer having 9+ year experience, implementation and having strong knowledge of technical specifications, workflow development. Ability to perform effectively and efficiently in team and individually. Always enthusiastic and interseted to study new technologies

  • Skype ID: tthanhthuy

Tìm kiếm bất động sản

 

Advertisement

 

jobsora

Dich vu khu trung tphcm

Dich vu diet chuot tphcm

Dich vu diet con trung

Quảng Cáo Bài Viết

 
Thông tin từ DrupalCon Amsterdam cho Frontend developers

Thông tin từ DrupalCon Amsterdam cho Frontend developers

DrupalCon Amsterdam is less than one month away! I'm excited to meet up with all the Frontend developers who are coming to learn new things from each other.

Yu Pan là đồng sáng lập PayPal

12 khai quốc công thần của YouTube giờ đang làm gì?

Hiện tại, ông đã rời công ty và chuyển sang làm kỹ sư phần mềm cho Origin Protocol - doanh nghiệp được sáng lập bởi cựu nhân viên YouTube Matthew Liu

Ở phần SEO audit tiếp theo sẽ giới thiệu lần lượt một số công việc triển khai

Ở phần SEO audit tiếp theo sẽ giới thiệu lần lượt một số công việc triển khai

Đa phần các bước và công cụ thực hiện không phải xa lạ với mọi người, phạm vi bài viết chỉ để hệ thống lại

Công ty diệt chuột T&C

 

Diet con trung