Search Optimization
  Home arrow Search Optimization arrow Page 6 - Working 'Smarter' with Templates
SEO Chat Forums  
Choosing Keywords  
Google Optimization  
Link Trading  
MSN Optimization  
Search Engine News  
Search Engine Spiders  
Search Optimization  
Web Directories  
Website Marketing  
Website Promotion  
Website Submission  
Yahoo Optimization  
SEO Tools
Adsense Calculator
AdSense Preview
Advanced Meta-Tags
Alexa Rank Tool
Check Server Headers
Class C Checker
Code to Text Ratio
CPM Calculator
Domain Age Check
Domain Typos
Future PageRank
Google Dance
Google Keywords
Google Search
Google Suggest
Google vs Yahoo
Indexed Pages
Keyword Cloud
Keyword Density
Keyword Difficulty
Keyword Optimizer
Keyword Position
Keyword Typos
Link Popularity
Link Price Calculator
Meta Analyzer
Meta Tag Generator
Multiple Link Popularity
Page Comparison
Page Size
PageRank Lookup
PageRank Search
Robots.txt Generator
ROI Calculator 
S.E. Comparison 
S.E. Keyword Position 
Site Link Analyzer 
Spider Simulator 
URL Redirect Check 
URL Rewriting 
Mobile Linux 
APP Generation ROI 
IBM® developerWorks 
SEO Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
SEARCH OPTIMIZATION

Working 'Smarter' with Templates
By: Bill Sterzenbach
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 9
    2004-08-23

    Table of Contents:
  • Working 'Smarter' with Templates
  • Selecting a Template Engine
  • A Typical Dynamic Web Page without Templates
  • Putting Smarty to Work - A Dynamic Template-driven Web Page
  • Places Where Smarty Shines
  • Common Mistakes with Smarty

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Working 'Smarter' with Templates - Common Mistakes with Smarty


    (Page 6 of 6 )

    Doing comparisons in a loop (section)

    It's best to do your comparisons in your php and pass the final recordset down to Smarty. This greatly improves performance. This really applies to anything you would do with smarty in a section loop. If possible, do your programming in your php and pass a ready-to-go recordset to Smarty.

    Mixing “Some” HTML into your PHP code

    It is almost unavoidable to put some HTML into your PHP code, but you must resist this at every opportunity. As more and more HTML begins to creep into your PHP you will find the benefits of templates diminishing.

    Overuse of Smarty Functions

    Many developers become so enamored with the convenience of the Smarty functions that they tend to overuse them in their templates. Too much of this behavior and you have the same problem that you had before templates only with a whole new subset language – not the ideal situation.

    “Some” Templatizing

    Using templates doesn't have to be an all-or-nothing proposition, but templates become more hassle than they are worth when used in some areas of the site but not in others. This practice leads to several versions of the same page lying around waiting to make your life miserable down the road.

    Wrapping it Up

    If you're looking to simplify/streamline your design and development process, templates are definitely one of the major components to reach that goal. Of the various templates out there, I chose Smarty. My suggestion to you would be to try a few of them on small projects and come to your own conclusions about which system might be right for you. If you decide to give Smarty a go and need a hand here and there, don't hesitate to give me a shout by clicking on the Discuss link for this article and I'll help where I can. Also, if interested, I can provide many real-world examples of more advanced uses of Smarty.
    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

     

    SEARCH OPTIMIZATION ARTICLES

    - Has Your Website Been Hacked?
    - WordPress 301 Redirect: Tips and Techniques
    - Five Ways to Optimize Pages
    - Updating WordPress Tips and Techniques
    - WordPress Database Tutorial: Security, Backu...
    - Submit and Update a WordPress Plug-in
    - Are You Optimized? Use SEO Analysis
    - WordPress SEO Tips: Benchmarking Matt Cutts ...
    - How to Increase the Conversion Rate of Your ...
    - SEO Strategies: A Guide to Which Ideas Work ...
    - Setting Up Feedburner for SEO
    - How to Use Feedburner for SEO
    - Statistical Process Control Implementation i...
    - Create Focused SEO with Subtitles
    - Ivan`s SEO Tips





    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 10 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek