Hey Guys,
I bet this is probably something really stupid.
Here's the issue I am having
I have a content type called "landing-page" Each of these landing pages share the same layout but I would like the css to change according to each individual landing page.
For example
Lets say I create 3 different landing pages. One for cats, one for dogs, and one for Chimps.
Currently these have the same layout established in a papge-landingpage.tpl.php file.
I would like to know if its possible to add a snippet of code to the tag in the template file, or something so that it identifies the page with a node id, or url so that I can theme these pages with custom css (use dog related imagery for the dog page, cats for the cat page, and chimps for the chimp page)
If its mysite.com/dogs
the landing page php can have something like
<body id="<?php print $nodeid or $nodetitle or $path ?>">
so that the output is something like this
<body id="6">
<body id="Post Title">
<body id="path-to-my-post">
or something like that so I can go in the css and style it with something like
#6 .content{
background:url('dogbg.png');
}
#post title .content{
background:url('dogbg.png');
}
#path-to-my-post {
background:url('dogbg.png');
}
I would greatly appreciate it if you guys can help me.
Thanks in advance
Comments
I am pretty sure this is not
I am pretty sure this is not the best way to do it but it works.
I will gladly take suggestions on how to make this better/right.
Currently I just added this to the container div on my landing-page template file
from there I am able to style pages by
I'm pretty sure its not the best solution but its working right now. If you have any suggestions please let me know.
Skinr module
Maybe you can try Skinr module : http://drupal.org/project/skinr
With it you could add specific CSS class for your node (or page).
------------------------------------------------
http://www.ilemaurice-bonplan.com