Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 Templates for Website and Web-App, TPL Files

views
     
TSPennywise
post Feb 18 2006, 10:47 PM, updated 20y ago

Look at all my stars!!
*******
Senior Member
5,796 posts

Joined: Jan 2003
Anyone know where I can get some reading material on TPL file type? I yahoo-ed and google-ed and only found most linked to PHP.

I'm using Visual Studio 2005, ASP 2.0 and C#... Does it work with TPL file type?
silverhawk
post Feb 19 2006, 01:43 AM

Eyes on Target
Group Icon
Elite
4,956 posts

Joined: Jan 2003


the .tpl file type is nothing more than just a name.
There's no specific format to it, as you will notice its just HTML in it with some special tags/constructs which the language will parse.

You don't need this in ASP.NET. Since you will have a file with the html stuff (.aspx) and the other with the code (.cs)
TSPennywise
post Feb 19 2006, 03:30 AM

Look at all my stars!!
*******
Senior Member
5,796 posts

Joined: Jan 2003
Yea but what if i want my web-application to fit into a website... Should I build the website first, or the web-app first?
silverhawk
post Feb 19 2006, 05:21 PM

Eyes on Target
Group Icon
Elite
4,956 posts

Joined: Jan 2003


Your web application IS a website in a sense. Normally i work on the application logic before going on the UI. Either way, your website is part of your web application.
salcom
post Feb 19 2006, 10:52 PM

Casual
***
Junior Member
432 posts

Joined: Jan 2003
From: As high as space as low as deep sea


.tpl paired with php to reduce the hassle of updating the website. for eg. u have a header on every page and you don't want to spend times changing every single page in php. That's why tpl came in. you will use the command {include "bla.tpl"} to include a tpl template into your website

hope that helps you
TSPennywise
post Feb 20 2006, 12:32 AM

Look at all my stars!!
*******
Senior Member
5,796 posts

Joined: Jan 2003
QUOTE(salcom @ Feb 19 2006, 10:52 PM)
.tpl paired with php to reduce the hassle of updating the website. for eg. u have a header on every page and you don't want to spend times changing every single page in php. That's why tpl came in. you will use the command {include "bla.tpl"} to include a tpl template into your website

hope that helps you
*
So tpl is sorta like cascading style sheet? Is CSS the only working template that goes along with ASP.net 2.0?
silverhawk
post Feb 20 2006, 01:42 PM

Eyes on Target
Group Icon
Elite
4,956 posts

Joined: Jan 2003


*sigh* you still don't get it.... no, tpl is not like CSS. Its an information structure file at best. The user interface basically has 2 components
  • Information Structure (semantic)
  • Interface Style (presentation)
The structure of the information is independant from how it would be styled. For example.

CODE

<html>
<head>
   <title>{SITE_NAME}</title>
   <link rel="stylesheet" type="text/css" media="screen" href="style.css" />
</head>
<body>
<div id="header">
   <h1><img src="{SITE_LOGO}" alt="{SITE_NAME}" /></h1>
   <div id="navigation">
       {NAVIGATION_MENU}
   </div>
</div>
<div id="content">
   {CONTENT}
</div>
<div id="footer">
   {FOOTER_MSG}
</div>
</body>
</html>

That is an example of a template file. The file extension doesn't matter.. it could be .tpl, .html, .pennywise, etc. What is important is that the templating engine knows how to parse the variables or control structures... which in this case would be anything between {}.

The style would be based on the CSS file, so you could have the navigation menu on our left, at the top, on the right, etc.

So here are some examples of how template files and css are used.

PHPBB
  • Information Structure (.tpl)
  • Interface Style (.css)
My own CMS
  • Information Structure (.html) (i use the SmartTemplate templating engine)
  • Interface Style (.css)
ASP.NET
  • Information Structure (.aspx)
  • Interface Style (.css)
So in ASP.NET you already have your template file... its the .aspx file. Your application logic should be in the .aspx.cs file and how you style your site should be based on .css.

This post has been edited by silverhawk: Feb 20 2006, 01:43 PM

 

Change to:
| Lo-Fi Version
0.0149sec    1.25    5 queries    GZIP Disabled
Time is now: 23rd December 2025 - 01:13 PM