Joe Velez began developing for the web in 1998. He is an avid vBulletin user and volunteers his services as a vbulletin.org administrator. He currently spends his time maintaining and developing allnurses.com.
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.
<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>
When visiting each section, the script will build the HTML by using the variables for the specific page and putting the following templates together: PAGE + page_sidebar + page_content + page_footer
The title and content for each page is as follow:
Variables for our policy page:
$title= 'Site Policies';
$text= 'Hello world! This are my policies...';
Variables for our rules page:
$title= 'Site Rules';
$text= 'In order to participate you must follow our 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.