PDA

View Full Version : Change stylevar with plugin


derdiedastim
12-22-2010, 10:59 AM
Hi,
is it possible to set/change a stylevar, for example doc_maxWidth, in a plugin?

I tried $stylevar['doc_maxWidth'] but this doesn't work or i choose the wrong hook...

Lynne
12-22-2010, 02:54 PM
No, you cannot do that. You may write a plugin that adds more CSS to the page and that CSS can override whatever the old CSS is that you are trying to change.

postoronnim
02-10-2012, 03:23 PM
This is an old thread), but maybe someone will search the answer and not find, like me.
Now you can change a stylevar in a plugin with the 'fetch_template_complete' hook. For example:
if (THIS_SCRIPT == 'css') {
$vbulletin->stylevars['forum_sidebar_width']['size'] = 236;
}

BirdOPrey5
07-31-2014, 06:48 PM
I know this is old. I'm adding Style Variable to the page so that Google will index the page with the word Style Variable as well. I knew this page existed, and I was pulling my hair out trying to find it. When I finally changed Style Variable to stylevar it came right up. Now hopefully it will get properly indexed for bother Style Variable and stylevar. ;)

tbworld
07-31-2014, 07:37 PM
I remember doing this along time ago, so I checked my library and found that I did it the same way. So I must have come across the thread myself once in a blue-moon ago. :)