![]() |
Template Css adding in my addon
I used this plugin to upload my template.css, but sometimes is it loaded and others no why? (vBulletin 4.1.5)
Code:
In several articles I found this code, but everyone says outdated Code:
<plugin active="1" executionorder="5"> Regards |
Take a look at the headinclude template:
HTML Code:
<vb:if condition="$vboptions['storecssasfile']"> PHP Code:
|
Thanks Lynne
I have to replace xxxx and yyy with the name of my template.css, is it correct? Regards |
No, not exactly. The _links hook requires a full on link. (I actually got this code from one of BOPs mods.)
Try this: Code:
$template_hook['custom_css_links'] .= '<link rel="stylesheet" type="text/css" href="clientscript/vbulletin_css/style' . str_pad($style['styleid'], 5, '0', STR_PAD_LEFT) . $vbulletin->stylevars['textdirection']['string'][0] . '/ct_thread.css" />'; |
1 Attachment(s)
Thanks it works fine.
You know how these two ways of interpreting the CSS code Regards |
I have no idea why that gap is there. You'd need to analyze the box using something like firebug.
|
I actually got in to some trouble with this a few minutes ago and Lynne was kind enough (as always!) to point me I'm using process_tempaltes_complete instead of parse_templates.
With that help, now I am using this in my codes: PHP Code:
|
Hi CvP
Thanks, but your code works fine on my addon with parse_templates hook, doesn't work with process_tempaltes_complete regards |
Yes, it needs to be on parse_templates. I used process_templates_complete and banging my head on table until Lynne stepped in.
|
Quote:
|
Quote:
|
Changing this up a bit....in the headinclude template here:
HTML Code:
<!--[if lt IE 8]> Also, if we can use that hook location, would we use the same method of adding to the store css as files? Like this maybe? ..... HTML Code:
$template_hook['headinclude_css'] .= '<link type="text/css" rel="stylesheet" href="' . vB_Template::fetch_css_path() . 'sidebar-ie.css' . '?d=' . $style['dateline'] . '" />'; HTML Code:
$template_hook['headinclude_css'] .= 'sidebar-ie.css'; |
If you want to add something for IE only, you need to put that comment code around it.
|
So something like this should work, right?
PHP Code:
|
This appears to work (not sure if it's correct though) .....
PHP Code:
|
Not to beat a dead horse, but how come the css files don't need to be rendered before you add them to the hooks?
|
Because they are special and dealt with in a different way?
|
Are you guessing? ;)
How's this for posterity, young lady? Quote:
That is in my first mod using the css hooks. I'll make you famous. ;) |
Wonderful. Do I get the fortune that comes with being famous?
|
Whatever you want. You know I'm a sucker for your charms. ;)
|
All times are GMT. The time now is 07:18 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:
|