Page 1 of 1

.tpl file extensions

Posted: Fri Jan 14, 2005 3:08 pm
by neophyte
What gives with giving template files .tpl extensions? Why can't developers use a normal accepted web extension for html? You know -- ".html." Template classes will take, .html, .htm, or .txt file extensions? Adobe Photoshop has claimed the ".tpl" extension. They overwrite the headers on everyfile on the hard drive that has .tpl. It's horribly annoying because my webserver won't recognize the headers and so won't display the html correctly if at all. So? Why ".tpl" ---- Does anybody else get annoyed when developers get 'creative' with their file extensions?

PS Anybody remember that SNL commercial "Adobe the little red car that's made out of clay?" :D

Posted: Fri Jan 14, 2005 3:16 pm
by JAM
I'm confused.

You mention that the webserver cannot display the html if it's in the *.tpl file? So far *.tpl isn't widely used for anything else than Smarty (or other similiar template systems).
It shouldn't be parsed by the webserver as is, but rather processed by the template system(s) before showing it. Hence the name, template.

Or did I completely misunderstand you? =)

Posted: Fri Jan 14, 2005 3:19 pm
by feyd
extensions are purely arbitrary, since it's the data contained inside that tells us what the file really is.. unfortunately, file identity is lost of a lot of applications. I guess that's a bonus of the Mac file system. At any rate, .tpl just tries to signify to php and potentially other programmers that a template is probably inside the file. It can be HTML, or plain text.. or anything else the developer of the tools decided on. You can rename them all to .tpl.php or whatever you want.. it's arbitrary. The tool just needs to know what to look for.

http://filext.com/detaillist.php?extdetail=TPL

If you look there, you'll notice that .tpl is used by a lot of applications.

.tpls

Posted: Fri Jan 14, 2005 3:37 pm
by neophyte
feyd wrote:extensions are purely arbitrary, since it's the data contained inside that tells us what the file really is.. unfortunately, file identity is lost of a lot of applications. I guess that's a bonus of the Mac file system.
I think you might be hitting on what I'm experiencing Feyd. Photoshop stores it's doutone styles in a ".tpl" files. On my mac I think the headers or something might be getting messed up because once any file with the .tpl extension hits my file system It gets corrupted or something. It won't display properly on my server. Thus the rant.

But I still think it's loads better when people stick to well known and established file extensions. Who knows what ".tpl" is outside of the PHP community? And what is a template file but HTML with bracked variables? Throw it in a "template" directory and make em ".html"

I've not had this file extension problem on windows or linux.

Anybody else have this problem on a Mac system?

Posted: Fri Jan 14, 2005 3:42 pm
by feyd
you could potentially use RezEdit to "fix" them.. or just make sure they are .html or some other extension before loading them on.. it's a pain, but it may help..

Posted: Fri Jan 14, 2005 3:57 pm
by neophyte
Yeah that's what I have been doing. I've been coping the file on the server to *.txt. Then I download them. But it's a pain in the arse. What's rezedit?

Posted: Fri Jan 14, 2005 4:02 pm
by feyd
haven't been using a Mac for long huh? ;)

sorry.. ResEdit:

http://www.google.com/search?hl=en&c2co ... dit+%2Bmac

Posted: Fri Jan 14, 2005 4:45 pm
by neophyte
Well actually I've been using a mac for about 6 years. I started with Mac OS 9. (I'm not counting the Apple II days) :D But I've never heard of ResEdit... :P :oops:

Re: .tpls

Posted: Sat Jan 15, 2005 2:56 am
by Roja
neophyte wrote: But I still think it's loads better when people stick to well known and established file extensions. Who knows what ".tpl" is outside of the PHP community? And what is a template file but HTML with bracked variables? Throw it in a "template" directory and make em ".html"
Simple: They are *NOT* html.

They arent valid html, they arent meant to be viewed directly, and putting .html on their extension will cause some webservers to offer them up AS legitimate html - which they arent.

Can a template BE valid html? Sure. But templates by definition (containing bracketed variables, possibly logic structures, and even php code), are not html.

So lets restate the question:

Q: Why would you want templates to be called something they arent?
A: Because of a unique bug you are experiencing in MacOS.

Doesnt sound like a template extension naming issue, from where I sit. :)

Re: .tpls

Posted: Sat Jan 15, 2005 9:12 am
by neophyte
Roja wrote:Simple: They are *NOT* html.
True, so why not use ".txt"?
Roja wrote:They arent valid html, they arent meant to be viewed directly, and putting .html on their extension will cause some webservers to offer them up AS legitimate html - which they arent.
So someone browsing through a templates directory might see garbled html on their screen?
Roja wrote:Can a template BE valid html? Sure. But templates by definition (containing bracketed variables, possibly logic structures, and even php code), are not html.
True. Templates are definitely not vaild html. Although they do contain some html tags
Roja wrote:So lets restate the question:

Q: Why would you want templates to be called something they arent?
A: Because of a unique bug you are experiencing in MacOS.

Doesnt sound like a template extension naming issue, from where I sit. :)
Ohhhhhh Mac hater. :wink: I use windows and linux on a regular basis too. I hate the way windows by default won't show file extensions. Linux rulz! :lol:

I have to admit this is a pretty annoying problem for a mac user. This isn't entirely about macs.

Extensions do matter, try using php without a ".php" extension.
Someone, somewhere decided ".tpl" should be used for template files.
I'm just wondering why? Why use .tpl? It's just a text file. It's not "valid" html, and with out the template class to convert it into "valid" html it's just text.

Everyone has used .tpl as an extension for template files. I have. The Smarty docs suggest people should use it.

Isn't always better to stick with well established naming conventions?

Posted: Sat Jan 15, 2005 9:23 am
by feyd
Why? because it's not exactly a "plain text" file either. It's a specialized version of a text file. The person that decided the extension probably wanted to quickly categorize the files. The easiest in the *nix and Windows worlds is through the extension.

Posted: Sat Jan 15, 2005 10:05 am
by neophyte
Well there really is no right or wrong answer.
You like potato and I like po-tah-to,
You like tomato and I like to-mah-to;
Potato, po-tah-to, tomato, to-mah-to -
Let's call the whole thing off !

:D :D :D :D :D :D

Posted: Thu Feb 17, 2005 5:49 pm
by Cronikeys
It is just a way to organize files better IMO ;) for example:

Aasdf.JPg should be aasdf.jpg ;)

and

header_template.txt SHOULD BE header_template.tpl for organizational sake ;)

This is just my opinion ;) it is like in math, why use X? Why not W? ;)

Posted: Thu Feb 17, 2005 6:25 pm
by d3ad1ysp0rk
Not to revive an old topic or anything...

Posted: Mon Feb 21, 2005 1:54 am
by g00fy_m
i use .tpl.html :D (sometimes)

regs

g00fy