View Full Version : Templates Reference Guide

12 Mar 2008, 02:13
Many people seem interested in learning to modify the vBulletin templates, but find it difficult at first because they don't know what template controls what. Here are a few helpful tips to make learning easier.

Add Template Name in HTML Comments

vBulletin has an option to add comments in the source output at the start and end of template usage. To enable this feature navigate to

AdminCP -> vBulletin Options -> General Settings

Find Add Template Name in HTML Comments and set it to yes.

Now that this is enabled you can go View Source on any page and you will see comments in the source specifying where a template was used.

vBulletin Template Reference Sheets

vBulletin has a great online manual that for some reason lacks reference sheets as to what templates are used where; so I decided I'd make some :) Attached to this post are 3 images that show template usage on the FORUMHOME, FORUMDISPLAY, and SHOWTHREAD pages. I hope you find them helpful.

vBulletin Online Manual

The vBulletin Online Manual is an excellent source for information regarding the vBulletin style system. In addition to information concerning using the style system itself, it also contains a CSS class reference sheet that shows what areas of vBulletin are controlled by what CSS selectors. Below are some links you may find useful.

vBulletin Styles Intro (http://www.vbulletin.com/docs/html/stylesintro)

Information about the legacy postbit (http://www.vbulletin.com/docs/html/stylesintro)

Creating vBulletin popup menus (http://www.vbulletin.com/docs/html/templates_vbmenu)

Collapsible elements (http://www.vbulletin.com/docs/html/templates_collapsing_elements)

vBulletin Template / CSS Color Reference (http://www.vbulletin.com/docs/html/color_maps_intro)

Thanks For Reading

I hope you found this tutorial useful and informative. Be sure to visit vbStartup.com (http://www.vbstartup.com) for more vBulletin styles, tutorials, and stuff. :D

12 Mar 2008, 13:17
thanks for sharing ... many will find this useful :up:

Michael Biddle
12 Mar 2008, 15:58
Useful indeed. Thank you.

15 Mar 2008, 23:48
Very interesting.

One question though...if you have a custom template, how do you add that to a plugin? I remember reading somewhere, I thought the manual but I can't find it again, that you're supposed to create the template with debug turned on and under the GLOBAL style. Is that correct?

Basically, I want it so that uninstalling the plugin will cause the new template to disappear from the template list...

16 Mar 2008, 00:01
Templates can be attached to products, not plugins.

You need to make a new product and attach both the plugin and template to it. To do this you'd make a new product, then when you go to add the template, you do it with debug on and make it on the MASTER STYLE. Make sure when doing it that you select the new product from the 'Product' dropdown on the new template page.

16 Mar 2008, 00:27
Thanks, that was it. For some reason I keep forgetting it. Maybe because it isn't exactly intuitive what all those settings are for or really do...

--------------- Added 1205627673 at 1205627673 ---------------

Now I remember why I asked the question in the first place. There are some custom templates I created in vb 3.0.x

There is no edit button even when debug is on, to change product from "vbulletin" to custom, nor the Style to Master Style. I have tons and tons of these templates...

Is there any way to edit this? Or do I have to create a new template for each...

If there is no way to edit from the AdminCP, I'm willing to write a query and change those templates in the db if you know what values will need changing.

16 Mar 2008, 02:12
I doubt there's an easy way from the AdminCP... If you can write you're own query what you need to do is change the styleid field for each template to -1, the product field to the id of the product you want to attach them to, and the version field to the version number you entered when you made the product..

I don't know if this screenshot will help you visualize or not, heh.

16 Mar 2008, 02:23
Thanks! exactly what I needed. Boy will this ever make upgrades more palatable. I'm several versions back due to the nightmare of bringing up to speed a fully hacked board. Now I can give each hack a product / plugin and bring them each in one at a time peacefully. Hallelujah!