Closed (fixed)
Project:
Danland
Version:
7.x-1.0-rc2
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
8 Dec 2010 at 02:52 UTC
Updated:
26 Jan 2013 at 21:32 UTC
My first Drupal site used a subtheme of Zen, which included content-type body classes, so I could, for example, have different CSS styles for Blog entries than for Stories.
I'd like to do the same in a new site I'm working on, using my own custom subtheme of Danland.
I found this: http://drupal.org/node/162485
But I'm not a programmer, so I don't know how to incorporate that code in a way that also maintains the "sidebars-1" and "sidebars-2" body styles that already exist in Danland.
Any help would be greatly appreciated.
Comments
Comment #1
danpros commentedHi,
To add that classes without disturbing existing ids and body classes you can try the following steps:
with this:
To this:
Let me know if not working. Do not forget to clear the cache. I will updating the handbook for other users.
Dan
Comment #2
danpros commentedScroll to the bottom for more advanced body classes.
Comment #3
Katrina B commentedThanks. It's a good start. I recently located a more extensive set of code that covers pretty much everything I'd like to do with body classes:
I'd appreciate some help with how to incorporate it into the Danland theme. Thanks.
Comment #4
danpros commentedHi,
Follow the first step of my comment above then replace the whole template.php with this:
Dan
Comment #5
Katrina B commentedGreat. Thanks! My only worry is that my taxonomy terms are showing up in the body classes with the capital letters still in place. I should be seeing "tax-audition" as a class, but I'm seeing "tax-Audition" instead. Any suggestions?
Comment #6
ishmael-sanchez commentedwrap the term name in the PHP function string to lower function ex.
$body_classes[] = 'tax-' . strtolower(eregi_replace('[^a-z0-9]', '-', $term->name));Comment #7
danpros commentedThanks ishmael-sanchez,
Yes but since we already creating the function for that so just call it:
Comment #8
Caesar commentedhi, i want to give a different colour to danland sheet so that the background colour is not the same as the sheet colour
Comment #9
grkm2002 commentedHow do you achieve the results on this page for drupal 7 or is it already incorporated into the page-tpl.php file.