geekmas #3 cheap n nasty path css trick
The easiest way ever to tell your stylesheet where you are on you drupal website -with a little help from zen.
Sorry that im 1 day behind on my geekmas thingie, my GF gave me Guitar HeroIII yesterday as a "theres 6 days til you gonna 34, so you better have it now" .. So I have been Rocking all night \m/ Yeaaah!
One of the things that made me loose some of my hair in drupal is to create an easy way to tell where in a site you are.
So if you look at page created with the view or panels module you can easily tell the stylesheet to "hide this and make that column 200px..." etc
-I know the css puritist, are getting the knifes and are ready to attack - cause display:none is evil, bad & yadi yadi yadi... but dammit it gets the job done! (Ush i know im gonna get my ass kickes for this...)
Well the cheap n nasty trick here is easy & even forces us frontend geeks to look at the args() function
_phptemplate_variables to the rescue!
If you like me uses elements from the zen theme (template.php) this is gonna be really easy, but just so we all are on the same page.. what i do is just adding the path to the $body_classes, so I can add specific styles to a element on a given page, say body.news h2.title
Inside the template.php file in the _phptemplate_variables add this to the page case:
#000000">#0000BB"><?php
#007700">case #DD0000">'page'#007700">:
#FF8000">//paths -where are we...
#0000BB">$args #007700">= #0000BB">arg#007700">(#DD0000">'0'#007700">);
#0000BB">$body_classes#007700">[] = #DD0000">'path-'#007700">. #0000BB">zen_id_safe#007700">(#0000BB">$args#007700">);
#0000BB">?>Offcourse as the king of "self-promoting-bragging-loudmouthness-arrogance" - and denmark [tm] I have cast aside the zens css (well some of it), and templates and build my own css "framework" on top of it - yup i dont like it when its called .break but clearFix ;) .. and well i didnt wanna change the way i have been writing my css the last couple of years - yup im an oldy grumpy man


vWZlsuiDVkx
qzxRar hmL40Mdg41UrgAs6a