This post really only needs to be two lines long.
Line 1 – Download and install Firefox
Line 2 – Install Firebug
This point may not need making for a lot of people and so to them I apologise, but it’s worth making anyway because Firefox, and the extensions which one can use with Firefox, really can make a Drupal themer’s life so much easier. And even if only a couple of people who weren’t using these tools before reading this post start to that’s got to be a good thing. It’s also worth making this point because it’s easy to forget just how impressive Firebug really is.
Before Firebug, the Web Developer’s Toolbar was the long-time king of Firefox extensions for web designers. It installs a neatly arranged toolbar packed with useful stuff. If you don’t have this extension it’s definitely still worth getting as it has some nice features such as local validation checks, the ability to identify the exact size of any fonts, and an option to view the complete CSS of any site. But in terms of debugging, nothing today quite matches up to the power of Firebug.
I got the idea for today's post after I received an e-mail during the week from Colin who was wondering how I added a permalink, and then styled the links section so that everything (comments, read more, permalink etc.) lines up.
I thought this might be of general interest, so here's the answer.
It's basically just a two step process:
Step 1 - Add markup to the node.tpl.php file
To start with I just added some markup to the links div, and then positioned the whole links div at the end of my node.tpl.php file, right before the closing node div tag.
<?php if ($links): ?>
<div class="links">
<p class="permalink"><a href="<?php print $node_url ?>" title="Permalink to this my Drupal blog post">Permalink</a></p>
<?php print $links ?>
</div>
<?php endif; ?>This positioned the permalink within the links div before the other links.