Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
[vb4] Adding a stylevar
Carnage
Join Date: Jan 2005
Posts: 760

uk
by Carnage Carnage is offline 23 Jan 2010

I had no idea that most people had no clue how to do this or that it was even possible so here goes.

Step 1.
Put your board into debug mode by adding this


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

to config.php

Step 2.
Goto the style manager, you will now see an additional style 'MASTER STYLE'

Step 3.
Enter the stylevar editor for MASTER STYLE

Step 4.
In addition to the regular stylevar editor, you will have two buttons to add and delete stylevars. Click add stylevar

Step 5.
Fill in the form to add the style var. If you select a product you are working from from the dropdown, it'll be included in the product xml file when you export. Its always a good idea to prefix your variables so they don't conflict with other peoples. The product id makes a good prefix.

Step 6.
Setting the value for it in the master style, sets its default value.

Step 7.
You can use this stylevar in your templates with the following code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

You can also customise it as normal in any of your custom styles.

Step 8.
Remove or comment out the line you added in step 1 to take your board out of debug mode.
Views: 10117
Reply With Quote
Comments
  #2  
Old 25 Jan 2010, 01:44
cbiweb cbiweb is offline
 
Join Date: May 2004
Forgive my brain fart but how do I make it work after it's set up? How does vBulletin know what to do with it?
Reply With Quote
  #3  
Old 25 Jan 2010, 12:24
Carnage Carnage is offline
 
Join Date: Jan 2005
There are various types of style var; off the top of my head there are thigns like colour, border and background. Depending on the type you pick depenends on how vb handles it.

You use it just like you would any other style var.
__________________
www.giveupalready.com

If you want/need to contact me, best thing is to pm me on that site, username Carnage.
Reply With Quote
  #4  
Old 25 Jan 2010, 19:36
3DUInc's Avatar
3DUInc 3DUInc is offline
 
Join Date: Jan 2010
Real name: Tamela
This is really excellent and I will use this after the final updater. I bet vb will be adding many more stylevers because some are turned off and some are still needed. Excellent job

I think what cbiweb is referring to is how does the stylever know what it is assigned to change, like if you wanted a border around the body, how would the created stylever know that is what it is assigned to do? Im kinda wonderin this myself but I have not tried this so it may be self explaniory when you install it.

Again, excellent job
Reply With Quote
  #5  
Old 25 Jan 2010, 21:47
Carnage Carnage is offline
 
Join Date: Jan 2005
You basically need to put the style var into your own template.

As an example; my [pbpg] chess mod defines two style vars, one for the background of a black square, one for the background of a white square.

I then added these two style vars to a style sheet within one of the templates like so:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
www.giveupalready.com

If you want/need to contact me, best thing is to pm me on that site, username Carnage.
Reply With Quote
  #6  
Old 26 Jan 2010, 04:12
3DUInc's Avatar
3DUInc 3DUInc is offline
 
Join Date: Jan 2010
Real name: Tamela
ah-ha OK very cool and thank you. I understand fully now
Reply With Quote
  #7  
Old 09 Feb 2010, 13:04
yaghoub's Avatar
yaghoub yaghoub is offline
 
Join Date: Oct 2008
Real name: yaghoub
Group
StyleVar ID
Friendly Name
comments
whats fill this value
__________________
peroffesional vbulletin style = parsvbulletin

[email protected]
Reply With Quote
  #8  
Old 09 Feb 2010, 15:23
Carnage Carnage is offline
 
Join Date: Jan 2005
Group: this is used for where the style var is displayed in the style var editor; the bold titles are the groups. If you enter an unused title, a new group should be automatically created.

Stylevarid: this is the name for your style var and the name you use to refer to it in template. Must be unique

Friendly name: no effect at the moment, but it will at some point be used as the name the style var is called in the stylevar editor.

Description: not exactly sure where this is displayed but it should describe the style var

Other fields should be obvious.
__________________
www.giveupalready.com

If you want/need to contact me, best thing is to pm me on that site, username Carnage.
Reply With Quote
  #9  
Old 11 Feb 2010, 11:52
yaghoub's Avatar
yaghoub yaghoub is offline
 
Join Date: Oct 2008
Real name: yaghoub
thanks
__________________
peroffesional vbulletin style = parsvbulletin

[email protected]
Reply With Quote
  #10  
Old 11 Feb 2010, 16:12
cbiweb cbiweb is offline
 
Join Date: May 2004
Originally Posted by yaghoub View Post
Group
StyleVar ID
Friendly Name
comments
whats fill this value
See the attached screenshot for a visual explanation.
Attached Images
File Type: png stylevarParts.png (60.6 KB, 295 views)
Reply With Quote
  #11  
Old 11 Feb 2010, 23:30
BSMedia BSMedia is offline
 
Join Date: Feb 2009
is there a way to add a group?

If we export a skin, does the additional stylevars go with it?
Reply With Quote
  #12  
Old 11 Feb 2010, 23:58
cbiweb cbiweb is offline
 
Join Date: May 2004
Yes, if you enter a name in the Group field that doesn't already exist, it will create a new group with that name automatically.

As for your second question, I would think the additional stylevars will export just fine, since they would be part of the system once you add them.
Reply With Quote
  #13  
Old 12 Feb 2010, 13:17
Carnage Carnage is offline
 
Join Date: Jan 2005
They deffinatly export with products; the values will export with styles. I'm not sure what will happen if you import a style that has stylevars in it that the board you are importing to doesn't have.

My guess is that it would create them, if not you may have to export and import them using a product files in addition to the style file.
__________________
www.giveupalready.com

If you want/need to contact me, best thing is to pm me on that site, username Carnage.
Reply With Quote
  #14  
Old 15 Mar 2010, 20:47
testbot testbot is offline
 
Join Date: Feb 2009
is there away to append a style to another style using a plugin?

something like:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #15  
Old 11 Oct 2010, 23:12
8thos's Avatar
8thos 8thos is offline
 
Join Date: Aug 2010
Real name: DRE
I turned my vbulletin forums off and went into debug mode.

I opened up another browser and visited my site.

The debug menu was still at the bottom. How do I prevent that from happening?
__________________
www.8thos.com
www.qapla.com
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 11:36.

Layout Options | Width: Wide Color: