Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 Templates for Website and Web-App, TPL Files

views
     
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)
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.
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.0147sec    0.25    6 queries    GZIP Disabled
Time is now: 24th December 2025 - 09:23 AM