I used the path module to create a set of pages with URLs like the following:
mysite.com/state/California
mysite.com/state/Colorodo
mysite.com/state/Connecticut

What I would like to do is add a banner to any page that has a URL that starts with "mysite.com/state"

I already modified my template.php so I can theme according to content type. So to keep my template.php from getting too complex I was hoping to find a little conditional php statement that will render a line of HTML whenever the page URL matches the "mysite/state" pattern.

Comments

mndonx’s picture

Hi jeeves - You can check the content type from the page.tpl.php file, and have the image print from there:

<?php if ($node->type=='state'): ?>
  <img src="banner.jpg" />
<?php endif; ?>

Or you could make a page preprocess function that checks the node type and prints an image. But this sounds simple enough you might not need to do it that way.

Actually - are all the banners the same, or do they vary state to state?

Amanda