.tpl file extensions

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

.tpl file extensions

Post 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
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post 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? =)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

.tpls

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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..
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

haven't been using a Mac for long huh? ;)

sorry.. ResEdit:

http://www.google.com/search?hl=en&c2co ... dit+%2Bmac
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post 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:
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Re: .tpls

Post 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. :)
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Re: .tpls

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post 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
Cronikeys
Forum Commoner
Posts: 35
Joined: Sun Jan 16, 2005 9:14 am

Post 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? ;)
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

Not to revive an old topic or anything...
g00fy_m
Forum Newbie
Posts: 7
Joined: Mon Feb 21, 2005 1:46 am

Post by g00fy_m »

i use .tpl.html :D (sometimes)

regs

g00fy
Post Reply