Ticket #1028 (open enhancement)
Add CSS classes to body tag
- Created: 2015-04-02 21:24:56
- Reported by: Lirodon
- Assigned to: Studio384
- Milestone: None
- Component: templates
- Priority: normal
As mentioned in http://fluxbb.org/forums/viewtopic.php?id=8300, we were discussing the addition of per-page/per-forum class IDs to the body tag for semantics and possible use in themes.
History
Franz 2015-04-04 10:29:34

- Milestone set to 1.5.9.
Oh, to the body tag?
I thought this was about the topic and post elements themselves!?
Franz 2015-06-18 15:59:05

Judging by the topic mentioned in the description, what's requested is IDs with the respective forum's / topic's ID, so that styles can be applied to a specific forum etc.
adaur 2015-06-18 17:06:23

OK. Why in <body> in particular? I would rather do
<div id="punindex" class="pun">
<div id="forumID" class="punwrap">

Should this be addressed in v1.6 with the templating system?
or
Will the following be a possible solution?
In main.tpl:
<div class="punwrap">
replace with
<div class="punwrap<pun_class>">
In header.php:
add
// START SUBST - <pun_class>
$tpl_main = str_replace('<pun_class>', (isset($css_class) ? ' '.$css_class : ''), $tpl_main);
// END SUBST - <pun_class>
In viewforum.php
add
$css_class = 'forum-'.$id;
Franz 2015-07-06 09:43:05

- Milestone changed from 1.5.9 to 1.6.
Probably better suited for 1.6, I agree.