Tag Archives: Taxonomy

Drupal 7 – Create a taxonomy term selection list of a specific vocabulary @ 2

We talk about how to generate a taxonomy term selection list in the following post.
Drupal 7 – Create a taxonomy term selection list of a specific vocabulary @ 1

So we continue to add the jQuery/Javascript code such that when the term is selected, the browser will open the corresponding term page.

The following piece of jQuery/Javascript is redirect you to the selected term page.
Continue reading Drupal 7 – Create a taxonomy term selection list of a specific vocabulary @ 2

Drupal 7 – Create a taxonomy term selection list of a specific vocabulary @ 1

Next: Drupal 7 – Create a taxonomy term selection list of a specific vocabulary @ 2

I want to create a HTML selection list which contains the taxonomy terms of a vocabulary. When a option is selected, the browser will go to the selected term page. In this post, i would like to share how to generate a selection list by PHP.

I have a vocabulary which has terms in 2-level. The selection list could generated as follow.
Continue reading Drupal 7 – Create a taxonomy term selection list of a specific vocabulary @ 1

Drupal 7 – Mutiliple selection list for taxonomy using Hierarchical Select

Taxonomy is a must have tool for grouping relevant content together. On the other hand, with the help of Views and exposed filter, user could easily list out the content with specific taxonomy.

But when a taxonomy has more than 1 levels, the filter option list may get too long and become less user friendly. In the past, i tried to make a multiple selection lists by applying some Javascript and jQuery on the exposed filter. It turns out that the result is quite bad.

Recently i found that there is a module which could turn the multiple levels taxonomy into multiple selection lists. It is called Hierarchical Select written by Wim Leers who is also the author of Drupal CDN module. Let’s try it now.
Continue reading Drupal 7 – Mutiliple selection list for taxonomy using Hierarchical Select

Drupal 7 – Get number of nodes of Taxonomy Term in Views

About 2 months ago i published a post on how to get the number of nodes of a specific taxonomy term by term ID.
Drupal – Get number of nodes of Taxonomy Term by Term ID

Unfortunately, the taxonomy_term_count_nodes() no longer works in Drupal 7 but you can get the count by Views in D7.
Continue reading Drupal 7 – Get number of nodes of Taxonomy Term in Views

Drupal – Get the Number of nodes under a Parent Term

Previously, we talked about how to get the number of nodes of a specific term.
Drupal – Get Number of node of Taxonomy Term by Term ID

How about if i want to get the number of nodes under a specific parent term? Unfortunately, there is no such function. so i try to get that number by SQL. Here is the PHP code.
Continue reading Drupal – Get the Number of nodes under a Parent Term