Home arrow Technical Articles arrow Tutorials arrow 1: phpLD Template Tutorial - W3C Valid and Smarty Templates
Narrow screen resolution Wide screen resolution

Directory

Add Entry
Search

Login Form






Lost Password?
No account yet? Register
1: phpLD Template Tutorial - W3C Valid and Smarty Templates PDF Print E-mail
Saturday, 10 March 2007

In this series of articles we’ll be building a valid PHP Link Directory (phpLD) template. phpLD is the most widely used directory script on the internet and a free open source version is available, phpLDv2. The template will be designed using this open source version so all can follow. This article will be a several part series in a step-by-step fashion showing you how to design your very own valid phpLD template. Before diving into the design process we will need to cover two things: Valid Wed Design and Smarty Templates - the template engine used by phpLD.

 

Valid Web Design

This template tutorial will produce a valid web template according to the World Wide Web Consortium (WC3), the main organization pushing standards for the web. This article is not meant to discuss the importance of web standards but many articles are available. Probably a good place to start reading about valid web standards would be the W3C article on “Why Validate?

Smarty Templates

As you have probably noticed phpLD uses templates to generate the look of the directory. The template files are located in the intuitively named directory /templates/. In this directory, the basic installation comes with several files:

  • add_recrprocal.tpl
  • footer.tpl
  • header.tpl
  • link.tpl
  • main.tpl
  • pagerank.tpl
  • payment.tpl
  • paypal.tpl
  • rss2.tpl
  • submit.tpl
  • top_bar.tpl

These .tpl files are used by the smarty template engine, a set of tools provided to help with the design of web applications, helping separate the programming from the presentation of the application. If you are serious about designing phpLD templates I would suggest reading over the smarty template crash course and then come back to this tutorial. Don’t forget to book mark this article. You might want to note that Smarty Templates are used in number of other web applications including most php powered forums.
So now that you have read all about smarty templates we can continue on with the toutorial, if you didn’t understand the smarty templates or just want to get on with the tutorial you may not get everything out of this tutorial.

Overview of the Template Design

This tutorial will take a small step-by-step process to generate a general design. From there we will adapt this general design to fit our needs. To start this process we will first analyze the default template that comes with phpLD2 and explain the importance of each .tpl file mentioned above. We will then move on to generate a general 2 column design using CSS and XHTML. After, that we will take this general design and add our own style and custom content to several pages.

A preview of the next tutorial

Tutorial 2: The phpLD default template

In this tutorial will cover the general structure of the the default template and examine the function of each template file. This will provide us with some insight into how the template works and a small foundation to work for the development of our own template.

Comments (0)Add Comment

Write comment
You must be logged in to a comment. Please register if you do not have an account yet.

busy
 
< Prev

Newsflash

Dir-Resources.com has now opened up to free submissions of directories.  Please add your quality directory to the list, and make sure to add your logo and icon.