![]() |
|
Article Options |
Skinning: Understanding A Template-Based System
Princeton
Join Date: Nov 2001
Posts: 6,693
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. Vineland, NJ
by
![]() Rating:
![]() vBulletin uses a "template-based system" to render all web pages. ![]() 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)
TEMPLATE 2 (Template Name: page_content)
TEMPLATE 3 (Template Name: page_footer)
TEMPLATE 4 (Template Name: page_sidebar)
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';Variables for our rules page: $title= 'Site Rules';The Site Policies page will look this when completed: tut_temp.gif (click on thumbnail to view content) The Site Rules page will look this when completed: tut_temp2.gif (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? ![]() 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. No members have liked this post.
Last edited by Princeton; 23 Feb 2007 at 19:50.. |
||||||||||||||||
Views: 67740
|
Comments |
#2
|
||||
|
||||
very good info Princeton...thanks!
![]() No members have liked this post.
|
#3
|
||||
|
||||
appreciate the comments
![]() hopefully, it can help someone new to "Skinning vbulletin"
__________________
Former vBulletin.org Staff Member Latest Articles: Liquid Layout = Less Ad Revenue? How to Monetize Your Site Improve Web Page Performance How To Write For The Web If it needs instructions, there's room for improvement. Give users what they actually want, not what they say they want. And whatever you do, don't give them new features just because your competitors have them! No members have liked this post.
|
#4
|
|||
|
|||
A good article leaves not a doubt in my mind. Good work!
No members have liked this post.
|
#5
|
||||
|
||||
Nice tutorial, Princeton.
![]()
__________________
I'm italian, I am learning english.. so, please, if you see any errors in my grammar or spelling, let me know via PM. Danke! No members have liked this post.
|
#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
No members have liked this post.
|
#7
|
||||
|
||||
Are you asking which database table holds the templates?
__________________
Please feel free to PM me about custom work, installations, and upgrades! Eclipse Records - Streetcult Street Team No members have liked this post.
|
#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!! No members have liked this post.
Last edited by pappy1961; 10 Apr 2007 at 22:43. Reason: Automerged Doublepost |
#9
|
||||
|
||||
thanks pappy ... when I have time, I'll write some new articles.
![]()
__________________
Former vBulletin.org Staff Member Latest Articles: Liquid Layout = Less Ad Revenue? How to Monetize Your Site Improve Web Page Performance How To Write For The Web If it needs instructions, there's room for improvement. Give users what they actually want, not what they say they want. And whatever you do, don't give them new features just because your competitors have them! No members have liked this post.
|
#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 ?
![]() No members have liked this post.
|
#11
|
||||
|
||||
I have no idea what you are referring to.
But I'm going to say .. no, it has nothing to do with this topic. ![]()
__________________
Former vBulletin.org Staff Member Latest Articles: Liquid Layout = Less Ad Revenue? How to Monetize Your Site Improve Web Page Performance How To Write For The Web If it needs instructions, there's room for improvement. Give users what they actually want, not what they say they want. And whatever you do, don't give them new features just because your competitors have them! No members have liked this post.
|
#12
|
||||
|
||||
Originally Posted by cdembek
I'm also wondering about that.![]()
- Pc1203 No members have liked this post.
|
#14
|
|||
|
|||
Are there any complete "Walkthrouhgs" on how to create a complete style?
No members have liked this post.
|
#15
|
||||
|
||||
Thank you very much
No members have liked this post.
|
![]() |
«
Previous Article
|
Next Article
»
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Article Options | |
|
|
New To Site? | Need Help? |
All times are GMT. The time now is 16:08.