I have been trying this trick in my 2.0.11 forum using my own Theme, which is a tweaked Curve variation.
I made this code change to use an alternate css file (index_club.css) for the boards that are in the array.
<head>';
// The ?fin20 part of this link is just here to make sure browsers don't cache it wrongly.
// Deactivated code
// echo '
// <link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css?fin20" />
// Added code
// In order to pick an alternate Stylesheet per board
$club = array('44','5','6','45','9','64','60','62','53','61','54','7','55','10','56','36','13','11','12','27','29','30','14','15','16','17');
if(!empty($GLOBALS['board']) && in_array($GLOBALS['board'], $club))
{
echo'<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/index', $context['theme_variant'],'_club.css?fin20" />';
}
else
{
echo'<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css?fin20" />';
}
// Einde invoeging FJR
echo'<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/responsive', $context['theme_variant'], '.css?fin20" />';
It works mostly as I want, but I have one problem. Hoping that someone can help me sort this out.
When I am in the Board Index the default styesheet is used, which is correct.
Now that I select one of the board - for example Board 10 - the board index for this board is showing with the default css. I was expecting the alternate since board 10 is in the array.
Now selecting a topic IN board 10 the css changes to the alternate.
I was kind of hoping that the topic list in the board would also be shown with the alternate css.
Now I find that when I display a board that has child boards (board 44 has two child boards, board 4 and board 5) the alternate css IS shown for board index in board 44 but not in 4 and 5, yet all topics in all three boards use the alternate boards.
How can I set it up so that all board indexes for the relevant boards will use the alternate css? Maybe the $GLOBALS['board'] variable is filled differently in case a board has no child boards?