AdaptiveThemes Blog

Add JavaScript to Drupal 6 for the front page only

This cropped up in the Drupal forums today, again, so I dug this bit of code out since I was messing about with recently. If you want to load a .js file only for the homepage there's a couple of ways of doing it.

Change the XML or Feed icons with theme_xml_icon & theme_feed_icon

Here in the first of our series on over riding theme function we attack theme_xml_icon.

As you will read on the Drupal API page the function has largely been superseded by theme_feed_icon. Therefore it makes sense to look at both and kill two birds with one stone. They're very similar with only minor differences in their respective output.

So to the code - first lest take a look at the default functions.

Drupal Themable Functions - Where the Fun Really Begins

Drupal includes these groovy things called theme-able functions. A function is a bit of PHP that does something - like generate the output of the breadcrumbs or menu links.

When a function in Drupal is theme-able, it means we can override the default function and modify the output of it. Now that is where the fun really begins!

Over the next 6 months or so (yes, really, 6 months) I'm going to attempt to post about every single theme-able function in Drupal 6 (there's a lot), and show you a simple modification to each one.

Adaptive Themes is born

Adaptive Themes is one of those new old companies - new company, old hands. Everyone involved in Adaptive Themes has been around the Drupal block for many years, and Adaptive Themes represents the zenith of our theming experience.

We bring to you the finest themes built for Drupal today. Over the next few years we will be releasing dozens of new hot themes for the Drupal content management system.

Pages