[support] Different header image for each section

Dale McGladdery torelad at gmail.com
Mon Oct 22 23:11:45 UTC 2007


In situations where the image is static, CSS works well.

For example, in your page.tpl.php file:
  <?php $sectionname = some function that returns section name?>
  <body class="<?php print $sectionname ?>">
    <div id="header>Header stuff</div>

Then in your CSS file:
 .section1 #header {background-image: url(image1.jpg); }
 .section2 #header {background-image: url(image2.jpg); }

The best way to organize the tag classes/ids depends on your site.


On 10/19/07, Robert Morse <bob at morsemedia.net> wrote:
> Thanks. That sounds reasonable.
>
> > Message: 2
> > Date: Thu, 18 Oct 2007 20:59:23 -0400
> > From: sander-martijn <lists at severeddreams.com>
> > Subject: Re: [support] Different header image for each section
> > To: support at drupal.org
> > Message-ID: <4718016B.9080903 at severeddreams.com>
> > Content-Type: text/plain; charset=windows-1252; format=flowed
> >
> > The simplest way would be to create a block for each section and choose
> > to show it only for that section (eg. for about you would put about and
> > about/*).
> >
> > How you create/populate the image into that view depends on whether it
> > should be user editable, automatically rotating etc.  It's pretty
> > straight forward to create a view that displays an image in a category
> > (randomly if you want), for example.
> >
> >
> >
> > Bob Morse wrote:
> >> We?re working on a redesign of an existing site. They new design
> >> includes a photo in the header. But I?d like one photo to appear on all
> >> pages for one section (all pages grouped under one subject) of the site
> >> and a different photo for all pages of another section of the site, and
> >> so on.  Any ideas on the simplest way to implement this? We?re using 5.2.2.
> >>
>
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>


More information about the support mailing list