View Full Version : tpl vs html
pengrus
09-29-2003, 05:08 PM
I would like to host another template contest, but I would like to make sure if it is easy if my page will be in .tpl, not .html.
The .tpl is used with .php. Please let me know your thoughts on this. Easy, hard, the same compared to html template design?
Thanks!
pengrus
09-30-2003, 08:04 PM
Nobody answered. :unsure: Does that mean it cannot be done in .tpl file?
Palmer
09-30-2003, 08:08 PM
Most of us are not programmers. I will ask someone to answer this for you who is both a programmer and a designer. I'll be right back :)
geofharries
09-30-2003, 08:47 PM
To the best of my knowledge, you can easily include standard HTML, CSS, XML, or any other base-level code in your template file. So, to that end, it won't be an issue. Just swap out the content you'd need to replace with PHP variables, like this, and you're on your way.
<html>
<head>
<title><?=$title;?></title>
</head>
<body>
<h1><?=$title;?></h1>
<?=$body;?>
</body>
</html>
geof
Geof's right. You'll just need to go in on your end and add the template variables for any dynamic content.
You can essentially rename a .html file .tpl and expect it to work with smarty or fast templates or whatever your template engine of choice is.
geofharries
10-01-2003, 07:08 AM
Sitepoint (as usual) had a good article on PHP templating a few weeks ago. You might want to check it out:
http://www.sitepoint.com/article/1218
geof
vBulletin® v3.6.8, Copyright ©2000-2012, Jelsoft Enterprises Ltd.