Remove Node Lists from Taxonomy Pages in Drupal 7
If you use Drupal, you can’t help but love the Taxonomy module. After all, categorizing content goes hand in hand with creating it or managing it, and Taxonomy gives us a nice, flexible framework, especially when you throw fields into the mix. Unfortunately, every taxonomy term page comes with a default list of all the [...]
How to Enable Ubercart Product Image Zoom with Gallery Thumbnails
In my experience, ecommerce websites are their own beasts, with all sorts of specialized functionality that doesn’t get requested on other websites. One of the most frequent requests, and often times one of the most difficult to fulfill, is enabling product image zoom functionality along with gallery thumbnails that can seamlessly swap out the main [...]
How to Add Variations to a Drupal Theme
Recently, I did work for a few clients who needed several very similar websites launched in a single project, each of which using an almost identical (yet subtly different) theme. As I started configuring them on Drupal multi-site installations, it got me thinking: Is there a way to take advantage of the same sort of [...]
Attach Files to Taxonomy Terms in Drupal
From what I can tell, there are plenty of ways to attach files to nodes in Drupal, and even a few ways to attach them to users, but none that I could find to attach them to taxonomy terms (images through the Taxonomy Image module, for sure, but not files in general). My guess is [...]
Selectable Items per Page Hack for Drupal 6 Views
I’m sure regular contributors to Drupal will cringe at what I’m about to show you, but I found it to be a handy trick. Let’s say you’re using the Views module in Drupal 6 and you want a way to dynamically control the number of items listed in a view. In my case, a client [...]
Debugging Syntax Errors in PHP
PHP is unforgiving of syntax errors. Misplaced a semicolon? White screen of death. Mismatched your single and double quotes? White screen of death. Considering a career in Ruby on Rails? White screen of death. Okay, maybe not the last one, but you get the point. Unless you beg and plead with it to output errors, [...]
Output a Snapshot of All Defined Variables in PHP
The following line of code is one of the most useful diagnostic tricks in my PHP coding arsenal: <?php echo ‘<pre>’; print_r(get_defined_vars()); echo ‘</pre>’; ?> Simply input the above snippet of code into any PHP file and you’ll get a browser-friendly snapshot of all variables defined in the current scope. This is especially handy in [...]