...oder die Flinte in den Korn...pepe wrote:"das Gewehr in's Getreide"
body IDs and classes
Re: body IDs and classes
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
- swisscheese
- Posts: 138
- Joined: Mon 19. Feb 2007, 16:37
- Location: Solothurn, Schweiz
Re: body IDs and classes
Hi claus
Put this code in a frontend_render script:
Set the conf values:
You will get a div wrapped around your whole content something like this: (where level id 10 is a sublevel of level id 2 which is a sublevel of home level id 0)
You are able to set css stuff for a specific level with all the sublevels (eg .myclass_2 p {background:red;})
have fun, swisscheese
Put this code in a frontend_render script:
Code: Select all
if(count($LEVEL_ID)) {
foreach($LEVEL_ID as $val) $bodyclass .= $template_default['body']['class'].$val.' ';
$content['all'] = '<div class="'.$bodyclass.'">'."\n".$content['all']."\n</div>\n";
}
Code: Select all
$template_default['body']['id'] = 'myid_';
$template_default['body']['class'] = 'myclass';
Code: Select all
<body id="myid_10" class="myclass_10> <!--this comes out of the box-->
<div class="myclass_0 myclass_2 myclass_10 "> <!-- this comes from frontend_render-->
...content...
</div>
</body>
have fun, swisscheese
Re: body IDs and classes
Thank you
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
Re: body IDs and classes
Hi swisscheese,
[btw.: i like it very well]
as you mentioned above, this does not affect --> body tag.
but might be a good idea, anyway.
So, in addition for this approach CSS can / could / would be:
or even:
for those, who work it this way.
[btw.: i like it very well]
as you mentioned above, this does not affect --> body tag.
but might be a good idea, anyway.
So, in addition for this approach CSS can / could / would be:
and so on...body#myid_10 div.myclass_0.myclass_2.myclass_10 { styles: here; }
or even:
body#myid_10.myclass_10 div.myclass_0.myclass_2.myclass_10 { styles: here; }
for those, who work it this way.
- swisscheese
- Posts: 138
- Joined: Mon 19. Feb 2007, 16:37
- Location: Solothurn, Schweiz
Re: body IDs and classes
yep. couldn't find a way to inject body tag with frontend_render. So you'll get this div tag, but this shouldn't be a problem...Jensensen wrote: as you mentioned above, this does not affect --> body tag.
nope! so you will only affect level id 10 whithout any sublevel (and here #myid_10 {styles: here} would be enough code...)body#myid_10.myclass_10 div.myclass_0.myclass_2.myclass_10 { styles: here; }
if you want affect a whole tree under a certain level, you would put in your css .myclass_2 {styles: here;} This way, the level id 2 AND ALL levels, sublevels, subsublevels... will be affected
have fun, swisscheese