OUR BLOG

Black Antelope Blog

Antelope have lots of experience and strong opinions, and like to share! Here you’ll find tips and tricks on many things design and development.

Drupal 7 / LDAP Tutorial

This is a guide for a common integration of syncing users and groups between LDAP and Drupal 7.

Programatically creating a nested taxonomy list in Drupal 7

Say you have a taxonomy hierarchy in which you would like to create a nested list.  While it is possible to loop through a taxonomy tree and create the html markup using a number of conditional statements, this is far from ideal and prone to error.  I much prefer to use Drupal's theme functions whenever possible to generate html from a render array.  In this demonstration, we'll grab all taxonomy terms in a vocabulary and use some recursion to construct manageable data structures that we can then leave to Drupal to generate all the html.