What are .tpl files

Hi all

Have been searching for some information on .tpl files. Thing is I haven’t been able to find anything useful on the net (so far).

I know their template files and contain html but thats about it.

How do you create such files and do you need to link them to for example php?

Any assistance would be greatly appreciated.

Not used them personally but I believe that they’re native to Dreamweaver.

I think that if you create a site in Dreamweaver using templates then it will create a .tpl file which you can then enable editable regions and it will output things like header, navigation, footer etc that are consistent across a site.

Obviously this only has the benefit to Dreamweaver users so I’d personally just use something like PHP to include separate PHP files instead as it’s much more flexible and doesn’t rely on one bit of software :wink:

Thanks for the response. Thing is Dreamweaver template files have the extension of .dwt (library files having the extension of .lbi).

.tpl seem to be different template files - I’m not sure what they’re created in.

In that case I’m guessing that it’s just a PHP file that’s being used as a template for other PHP files to use.

A PHP file could be called a .inc or .tpl so it doesn’t have to have a .php extension.

I presume that the file extension is used so that the author can easily recognise which files are being use as templates, which are includes etc

I’d never go looking for a reason to use something that I don’t understand though. If you don’t know what a .tpl file is or when you need to use it then my guess is that you don’t actually need it :wink:

I’d always suggest designing a solution for a problem and not using a solution to find a problem :wink:

I guess it was just curiousity - Its just down to not finding a lot of info on the web - it got me curious…

.tpl files normally denote a html template file, often used in CMS’s, shopping carts etc.

Nothing wrong with asking questions about things you don’t understand, it’s the best way to learn.

A lot of people do find something neat that they like the look of though and then going and trying to look for a problem to solve with it which is usually the wrong way to approach things.

So has anybody found anything on .tpl files on web?


Albeit *.tpl is a generic file extension usually (when concerning web) and typically gets used for PHP files that are templates for forums although the extension is irrelevant really – usually it just makes it easier for the webmaster to recognise a file’s purpose if he so choses.

It could be equally as well be called *.dog or *.zog it makes no difference other than it gives us a clue if it looks like and abbreviated word, e.g. *.inc for include.

I’ve seen .tpl before on PHP/Smarty templates, it’s usually just a general-purpose undefined extension for templates.

I use them as templates in many applications that get parsed by a variety of server side languages.

They are a great way to keep your code separate.

last request - anybody know of a book or tutorial online explaining .tpl files in detail??

There isn’t anything to explain, the extension is highly irrelevant. ‘.tpl’ isn’t a real extension, it is just a generic text file.

Drupal http://drupal.org themes include *.tpl.php files. These are used by Drupal’s “PHP templating engine”.

Don’t forget to add the coversheet to your tpl reports, too.

That’s TPS reports to you ‘smarty’ (No pun intended)