The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Skinning: Understanding A Template-Based System
vBulletin uses a "template-based system" to render all web pages. [imglft]https://vborg.vbsupport.ru/images/portal/puzzle.gif[/imglft] In order to modify the design of your site, you will need to first understand WHAT? and WHY? a template-based system. WHAT IS A TEMPLATE-BASED SYSTEM? First of all, a template-based system (eg. vBulletin) is not the same as "templates" purchased at monstertemplate.com. Template-based system are files used by a particular program (eg vBulletin) that are not complete HTML files - they contain only parts of the HTML that the system puts together to build a web page. WHY A TEMPLATE-BASED SYSTEM? Templating is an easy way to create a web site without a lot of work in maintaining a consistent look and feel across the entire site. For example, all you have to do is modify a template and the modifications will reflect across every web page. SHOW ME AN EXAMPLE Are you still puzzled? OK, let's jump right in and play with an example. Let's say, we have 2 sections in our site: Site Policies and Site Rules. To render these sections, we have a total of 4 templates. TEMPLATE 1 (Template Name: PAGE) Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> $HTML </body> </html> Code:
<h1>$title</h1> <table class="tborder" width="100%" border="0" cellspacing="1" cellpadding="5"> <tr> <td class="alt1" width="180">$sidebar_content</td> <td class="alt1" width="100%"><p>$text</p></td> </tr> </table> Code:
<div class="smallfont">? Copyright 2006 GO-TOTAL LLC </div> Code:
<table class="tborder" width="100%" border="0" cellspacing="1" cellpadding="5"> <tr> <td class="thead">Sidebar Title</td> <td class="alt1"><div>This is the sidebar content.</div></td> </tr> </table> The title and content for each page is as follow: Variables for our policy page: $title= 'Site Policies';Variables for our rules page: $title= 'Site Rules';The Site Policies page will look this when completed: Attachment 52422 (click on thumbnail to view content) The Site Rules page will look this when completed: Attachment 52423 (click on thumbnail to view content) Now, just imagine this on a larger scale ... let's say 1000's of pages; and, you need to modify the copyright notice. Well, with a template-based system, all you have to do is modify the page_footer template; and the changes will be displayed on all your pages! Now, isn't that great? :up: What a great way to save time. Time is money! So you see, the idea behind a "template-based system" is that you only have to write the HTML 1 time; and, you can use it over and over again. It's similar to CSS (that's another tutorial) -- you only have to write it once and it affects the whole site. |
#2
|
||||
|
||||
very good info Princeton...thanks!
|
#3
|
||||
|
||||
appreciate the comments :up:
hopefully, it can help someone new to "Skinning vbulletin" |
#4
|
|||
|
|||
A good article leaves not a doubt in my mind. Good work!
|
#5
|
||||
|
||||
Nice tutorial, Princeton.
|
#6
|
|||
|
|||
how are the templates stored.. I know they are stored in a DB but which table do they get stored in.. lets say the header, navbar and footer templates... good read.. thanks for the post
|
#7
|
||||
|
||||
Are you asking which database table holds the templates?
|
#8
|
|||
|
|||
I for one would be VERY Grateful to Princeton for many more of those type explanations.
By the way Princeton, you have a frsh start newbie goin right here!! |
#9
|
||||
|
||||
thanks pappy ... when I have time, I'll write some new articles.
|
#10
|
|||
|
|||
Is there a way to change one style and it also changes other styles that u have? or my question is not the same as ur topic ?
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|