I am attempting to use the Connections theme on top of the CivicSpace (0.8.3) packaging of Drupal (4.6.4), testing with Firefox (1.5), and as you will be able to tell, this is my first drupal site development.
I wouild like to use (or modify) this (or another) theme to allow me to specify not just the title, alias, and body, but also a header image for each page. I presume I need to modify the page content creation screen to take another field to specify the image, and I would have to create a drupal variable to hold this data for later use in the PHP template. Is this correct? If so, then I would have another parameter I would use in the PHP template to specify the header image of each page.
Is the above what I need to do? Any pointers/examples about how to do this? Or is there an existing theme that already allows for a different header image per page that I could copy the method from?
If the above is difficult, is an alternate route to have one theme per page, where the themes differ only in the header image? If this is the route to go, how do I specify a different theme for each page?
Thanks for any help!
Mark
Comments
Well it depends on what you want to achieve
How you might do this depends on what you want to achieve.
If you want just a random image from a fxed set I think the banner module would work here. Or you could write some code to cycle through the set of images.
If you want the image to somehow related to the node you need to understand that not all pages are generated from a single node (this includes all the admin pages). You would need to decide what image you wanted to display for the non-node pages.
If you base the image on a node and you use taxonomy terms you could use the taxonomy image module to associate images with a term and then display an image based on the term for the node. If you want a unique image per node in the header you would need to associate the image with the node (probably with a custom module).
If its just the header image
If its just the header image you want to change then perhaps check out the "node image" module: http://drupal.org/project/node_image
I haven't used it myself, but looks like the kind of thing you are after :)
This thread may also have some helpful tips:
http://drupal.org/node/7651
><>tomskii
><>www.theanthillsocial.co.uk
In 4.7, the image module
In 4.7, the image module appears to generate a "random image" block. i'd consider finding the code to create that block, and reworking it to generate the url for the images in your header.
You'd probably want to write the script to only display images that were filed under a "header" taxonomy term since your going to only want to use rather large images in the header.
You might also consider dynamically generating CSS using PHP to control the background image. See here for info on that: http://www.lullabot.com/node/38
Should be relatively easy -- something I'm considering doing myself, so I'll contact you if I beat you to it. I know this isn't a specific solution, but its a plan of attack that I think might be easiest....
--
"I'm not concerned about all hell breaking loose, but that a PART of hell will break loose... it'll be much harder to detect." - George Carlin
--
http://nicklewis.smartcampaigns.com
--
"I'm not concerned about all hell breaking loose, but that a PART of hell will break loose... it'll be much harder to detect." - George Carlin
--
Personal: http://www.nicklewis.org
Work: http://www.zivtech.com
taxonomy.theme
Taxonomy.theme could work for you as well. Even better maybe. It lets to tag a node with a taxonomy definition and then based on that tag it themes the page based on other themes you have configured. The only issue is working with two themes, or more, and keeping the links and such consistant.
Sean
Cambridge Community Television
http://www.cctvcambridge.org
MINIML theme
I found Miniml theme -> http://drupal.org/node/42837 which has a random image header (or image rotator implemented). If anybody's interested.
Peli
www.em3r10.com
Header images as per the nodes
If this is just the header images which you want to change as per the node then you can see this post with code snippet http://drupal.org/node/94187
I think this will help you understand the logic.
Vivek Dubey
Unleash the Power of Drupal.