This forum is for assistance with theme development.

Different Header Images for Different Nodes

Drupal provides same header for the whole site and if we want to theme all the nodes individually then it’s a bit complicated process. While looking for alternatives to this, the following snippet work fine, this has been implemented in www.vinrcorp.com you can see the example before using it. The usage of the snippet is also quit simple just put this code into the header part or where ever you want, of page.tpl.php file of your theme.

Only local images are allowed.
	if ($node->nid == 1) {
	print 'image-1.jpg" />';
	}elseif ($node->nid == 2){
	print 'image-2.jpg" />';
	}elseif ($node->nid == 3){
	print 'image-3.jpg" />';
	}elseif ($node->nid == 4){
	print 'image-4.jpg" />';
	}elseif ($node->nid == 5){
	print 'image-5.jpg" />';
	}elseif ($node->nid == 6){
	print 'image-6.jpg" />';
	}elseif ($node->nid == 7){
	print 'image-7.jpg" />';
	}elseif ($node->nid == 8) {
	print 'image-8.jpg" />';
	}elseif (($node->nid == 9) | ($node->nid == 10)){
	print 'image-9.jpg" />';
	}elseif ($node->nid == 11) {
	print 'image-11.jpg" />';
	}else {
	print 'default-image.jpg" />';
	}

To use it just put images in the image folder and mention the path in the code and also replace the names of images as per the node ids. This will help you to display different banner images for different nodes.
I think you can use it and this works for you too. You can reply to this post for further help.

BlueMarine Question

Hi All

Fairly new here, working on a theme. I cannot figure out where the horizontal line that is going across the middle of the header in BlueMarine is coming from....is it a border? image? two divs not lining up?

I believe it is in the middle of the $header content that is the 2nd row of the header table. I've scoured the css and just can't figure it out. Where is $header constructed and what css does it use? Any chance one of you CSS experts know where this mysterious line comes from? ('cause I want to KILL IT)

Thanks,
Baer

Multiflex Theme

This Multiflex theme does not seem to have a place for a HEADER BLOCK in it and I wish to have one that extends across all three columns. Can someone out there look at the code and tell me where and what I need to edit as well as what code to insert in order to make this happen?
Thanks!


print $language
" xml:lang=" print $language ">


print $head_title



print $head
print theme('stylesheet_import', base_path() . path_to_theme() . '/css/style_screen.css', 'screen');
print theme('stylesheet_import', base_path() . path_to_theme() . '/css/style_print.css', 'print');
print theme('stylesheet_import', base_path() . path_to_theme() . '/css/style_override.css', 'all');
print $styles

print theme("onload_attribute");>

echo $layoutcode ">

Printer-Friendly View and CCK?

I have spent a long time theming a complex cck content type, and I would love to have a printer-friendly view that just removed all the navigational elements, much like the printer-friendly module does.

Unfortunately, that module doesn't seem to know about the node-contenttype.tpl.php file at all. It prints the data label with plenty of unwanted space followed by the field contents.

How to put all the comments in a collapsible fieldset ?

Hi !
I wonder how to put all the comments and the "add a comment" link in a collapsible fieldset ?
Could you tell me in wich file do I have to specify that please ?

Thank you .

Matt

Different between smarty tempate and phptemplate

i wanna know what the different between smarty template and phptemplate and how to use it ??

Pages

Subscribe with RSS Subscribe to RSS - Theme development