Skip to main content

Hacking the theme

May 3, 2010 by Steve

The Newswire theme is just about exactly what I wanted when I first started drawing out my site on paper. There are just a few things that I wanted to change. Here's what I did:

  • Moved the "tags" block of links ("Drupal, theme, hack") for each node from the bottom right to the upper left. (Both CSS and PHP changes required.)
  • Changed the look for <code> sections. (CSS)
  • Changed the first post on the front page to print out full length. (PHP)

These are changes that have to happen in the files that make up the theme definition. For my site here, I'm looking in sites/all/themes/newswire. This means if you have more than one theme in use on your site, each will need to be individually modified.

The PHP changes were made to the node.tpl.php file, which governs how each node is printed out. The CSS changes were made to a couple of different files. I never would have been able to find the right place for the style changes without the Firebug plug-in for Firefox. It allows you to right-click any spot on the page and "Inspect Element", which will show you all the style elements that go into making the page look the way it does.

@stevew99999

  • @MRFranklin20 switch back and forth for now. Words on paper is good. 5 years 42 weeks ago
  • Remote iOS controlled pan-and-tilt base for an iPhone? Yes, please! http://t.co/aUz8WxKI Need before next business trip! 5 years 42 weeks ago
  • @Holloboles Just a man. With a man's courage. Nothing but a man. But he can never fail. 5 years 42 weeks ago

Premium Drupal Themes by Adaptivethemes