![]() |
Conditional Plugin for additional.css
I'm attempting to create a plugin that will check certain conditions before appending css to additional.css. Here is what I have for a plugin at hook: cache_templates.
Code:
if in_array($foruminfo['forumid'] == array(2,7)) { I'm completely new to PHP and vBulletin so be nice. :-) |
Why not just create a new css template and just perform your condition and then decide to include the css template or not, rather than appending it to another css template.
|
Quote:
***EDIT*** Actually I'm not sure that header include is the best place. I only need to override specific css elements that are in forum.php and forumdisplay.php. So I don't need this condition checked on every page. |
Add your code to the bottom of the head include and be done with it as a normal conditional.
|
Quote:
I appreciate the help and advice so far! |
$GLOBALS[forumid]
|
Quote:
<vb:if condition="in_array($GLOBALS[forumid], array(9,11))"> <link rel="stylesheet" type="text/css" href="/clientscript/vbulletin_css/myfolder/mycss.css" /> </vb:if> I'm sorry for the nickel and diming. |
That looks fine, give it a shot? :p what do you have to lose?
|
Quote:
{vb:raw template_hook.headinclude_bottom_css} And the css file is not being included. I used firebug as well and can't find the inclusion of this file when hitting forum and forumdisplay. :( |
Just put it in the headinclude template, why are we being so complicated? :p
|
All times are GMT. The time now is 04:59 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|