Add tertiary links to your Drupal template
By default, Drupal gives you two menu variables to use in your templates. $primary_links contains the first level of navigation and $secondary_links contains the child pages of the active primary link.
But what if you need to display the children of the secondary links? Fortunately, Drupal user rapidsynergy has done the hard work for us in this comment he posted on the Drupal website. I'll reproduce his code here (with slight modifications) for future reference.
How to find latitude and longitude coordinates for a Google Maps location
Lifehacker came to my rescue this afternoon, showing me a dead easy way to find the latitude and longitude coordinates for any Google Maps location.
Disable TinyMCE on a per-field basis in Drupal
There's a post on avocadoshake.net, which describes how to disable TinyMCE on a per field basis in Drupal.
Instruct the Views module to add class values to each item of a list view
I had a client ask me recently to help them identify the first and last nodes of a list view by adding a class to each of the list items.
This can be done pretty easily by overriding the appropriate views theme function and injecting some of our own code into the array of rendered nodes just before they are converted to a list and displayed.
Simply paste the snippet below into the file named template.php residing in your theme's folder. If there's no template.php, go ahead and create it.
My favourite Drupal modules and why you should use them
Drupal's power and flexibility really comes into its own when you start using add-on modules to extend its functionality. Finding the really useful modules amongst the hundreds that are available can be a daunting task. To help you sort the wheat from the chaff, I've compiled a list of the sixteen Drupal modules that I use in almost every site I build.
Default text field value that disappears on focus
See the search form top right? Click the search box. See how the default text disappears and then reappears when you click away from the search box? Here's how you do it.
The script below searches the page that it's inserted on for all form input fields that have a class of default-value applied. Each form input field must have a unique ID.
AlphaImageLoader and links not working in IE6
Are you using the AlphaImageLoader filter to get your PNGs working properly in IE6? Are your links not working when nested inside an element with a PNG background image?
Here's how to fix it: IE AlphaImageLoader, Transparent PNGs & Links
By the way, this will also work if you're using IEPNGFix by TwinHelix.
Exploring Drupal's Htmlarea module
I've spent the last two days looking at Drupal's Htmlarea module. Similar to the TinyMCE module, this module acts as a wrapper for the Xinha WYSIWYG editor (Xinha is a fork of the original htmlArea WYSIWYG editor).
I like Xinha, though, as you might expect, it's not without its fair share of issues. The developer community for Xinha seems to be quite active though, and bugs are being addressed.
I've assembled a few preliminary notes here that might help you on your way:
Output secondary links as a menu tree
Thanks for this posting goes to rapidsynergy for posting the solution in this comment on the Drupal forum.
Problem: You're using $secondary_links to display the children of the active menu item in $primary_links, but $secondary_links has children too and they aren't displaying when their parent becomes active.
Solution: Add the following snippet to your template.php file:
Using the FCKEditor file browser with TinyMCE on Drupal
TinyMCE on Drupal offers support for user uploads of files (via the insert image and link dialogs) through the use of the IMCE module. Enable this module and the upload buttons automatically appear in these dialogs.
It's just not very good, is it?





