Monthly Archives: April 2011

Using the path_to_theme() function

When we build Drupal sites we typically have a lot of custom design elements. It is important to be able to display images from the filesystem in a dynamic fashion (non-absolute paths). Should you need to move the site, you

Tagged with: , , , ,
Posted in Development

Add Javascript to a Specific Page

There are several ways to add javascript code to a page in Drupal. The method outlined below involves a modification to your theme’s template.php file. You’ll be editing (and un-commenting if necessary) your theme’s preprocess_page function. This basically lets you

Tagged with: , , , ,
Posted in Development

Get Taxonomy Terms by Count

This function returns an array of taxonomy term objects. It is much like taxonomy_get_tree(), and it does in fact use this function. We had a client that wanted a grid of product categories with an image for each term, but

Tagged with: , , ,
Posted in Development

Taxonomy Menus for Custom Views

Note: If you’re looking to just output a list of taxonomy terms that link to a custom view, please see¬†PHP Code to Output a List of Terms Linked to a Custom View. If you need actual Drupal menu items for

Tagged with: , , , , ,
Posted in Development