MyBB Community Forums
How to programatically include theme CSS - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Themes (https://community.mybb.com/forum-103.html)
+---- Forum: Theme Support (https://community.mybb.com/forum-10.html)
+---- Thread: How to programatically include theme CSS (/thread-85802.html)



How to programatically include theme CSS - Tom K. - 2011-01-07

Ok, I've got most of my plugin working. Is there a static variable that returns the main CSS file of the current theme?

My Template is:
<html>
<head>
<title>{$mybb->settings[bbname]} - Example Page</title>
{$headerinclude}
</head>
<body>
{$header}
<br />
<!-- Content: Start -->
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder"><tr><td class="thead"><strong>BOX NAME</strong>
</td>
</tr><tr>
<td class="trow1">BOX CONTENT</td></tr>
</table>
<!-- Content: End -->
{$footer}
</body>
</html>

But I want to include the CSS of the theme somehow Toungue


RE: How to programatically include theme CSS - Damion - 2011-01-07

Wouldn't it be included in "{$headerinclude}"?


RE: How to programatically include theme CSS - Aries-Belgium - 2011-01-07

In your hook that calls the template, globalize the $theme variable:
function myfunction_hook()
{
   global $theme;
   //...
}



RE: How to programatically include theme CSS - Tom K. - 2011-01-08

I have included header include in my template, but it hasn't worked Sad I'm not using hook either Toungue