Accessing the body class
Today I'm trying to add a class to the
<body> (which usually has many classes already), by adding some PHP in a view.
Problem is, I'm not sure what 'some PHP' would be...
After some searching, I found this very interesting post:
$this->CssClass doesn't seem to work for me. I tried echoing it in a view and nothing at all was displayed, even though the body class wasn't empty at all.
Also, would that be useful to _add _a class to the
<body>, as well as just reading the existing classes?
edit: this discussion is kinda related too, but it's very old :P It would be good if a class like User-xxx was added to the
<body> when viewing user xxx's profile...
Another bit of info: dashboard/views/modules/me.php has this bit of code at the beginning:
if ($this->CssClass) $CssClass .= ' '.$this->CssClass;
echo '<div class="MeBox'.$CssClass.'">';
but I can't think of a single situation where the 'MeBox' has any other class besides that... so it would seem
$this->CssClass doesn't work in that file either?