Adding RefTagger to a Drupal Site: The right way.


Over on the Logos Bible Software Blog Phil did a write up on Adding RefTagger to a Drupal Site. I really like RefTagger for the way it turns any bible reference into a link with a snazzy little tool tip. (Like John 3:16) But unfortunately Phil’s tutorial leaves a bit to be desired.

He advocates hacking the page.tpl.php template file for your theme. But doing so is not recommended for the following reasons.

  1. You risk messing something up and ruining your theme. This may not be a big one for some folks who consider themselves savvy but if you’re uncomfortable at all – hacking source files is a bad way to make changes.
  2. You will definitely lose your work if you install an upgrade since it will just overwrite your changes.
  3. If you change themes you’re work is also lost and you have to keep hacking new template files.

With all due apologies to Phil what’s the recommended/best method?

Use Drupal’s powerful Blocks which are designed for insertion of various code excerpts.

  1. Log in as the administrator.
  2. Navigate to admin>Site building>blocks
  3. Click on ADD block or simply type this in your address bar: http://www.yoursitename.com/admin/build/block/add
  4. Paste the reftagger code into a block and name it something ingenious like “RefTagger”.
  5. Change the “input format” to full HTML and save the block.
  6. Then activate it as a footer block, it will remain invisible but will immediately tag every reference on your site!

Don’t mess with the template’s unless you absolutely have too, keep it simple and use Drupal the easy and correct way. 🙂