Images in Theme

berenErchamion - December 16, 2007 - 18:52

I'm building a theme starting from the Zen theme. I want to have some custom graphics in the header area near the logo. What's the best way to include these? I'd rather not have to hard code anything. I've poked around in some other themes to get ideas and this is the best I've come up with:

<img src="<?php print  base_path() . drupal_get_path('theme', 'zen') .'/images/commando_r.jpg' ?>">

but this still hardcodes the name of my theme. Is there a better way?

beren

API

yelvington - December 16, 2007 - 19:03

Ah cool - thanks. I guess I

berenErchamion - December 16, 2007 - 19:52

Ah cool - thanks. I guess I can take that ans strip off the end to get my theme's name...and then I can insert it, but then I'll need to hardcode the url pieces before this. Still seems not perfect, but definitely thanks for the tip.

beren

 
 

Drupal is a registered trademark of Dries Buytaert.