{PROJECT} ../../template/home_en.ini {GRAFIK_LINKS} $home/gifs/li_phpcms.gif {LOGO_1} $home/gifs/cmslogo1.gif {LOGO_2} $home/gifs/cmslogo2.gif {MENU} 00.08.10.02 {TITEL} Templates {CONTENT}


Description of Templates

Templates are like those templates from Word for standard uses. A template is a normal HTML file with substitute symbols in it.

The substitute symbols are then replaced by the real contents, which are under the same field name in the content files. This splits the content from the layout of a website.

We do not consider now the project file and the menus. We treat these things in the area about content files.


Usage of the "$home" - variable in templates

Often you have to use the absolute path to graphics and/or style-sheets in your templates. If you plan to transfer your hole website to another server or simply change the directorys in your serverroot you run in problems with absolut paths. Then you must change each path in your template by hand. You can avoid this, if you use the "$home"-variable from your project-file. Simply set these variable in the path to your graphics and in future you have to change this path in only one place - the project-file.


A simple Template can look e.g. in such a way:

An example

<HTML>
<HEAD>
<TITLE>{TITEL}</TITLE>
</HEAD>
<BODY>
<H1>{TITEL}</H1>
<P>
{CONTENT}
</BODY>
</HTML>

We assume that in the first content page after the field {TITEL} the words: " my first homepage with phpCMS " and after the field designator {CONTENT} the words: " here is unnecessary talk, which is then inserted into the template.
You can use normal HTML tags for formatting. More intelligent it is however to use own TAGS to format a content.

The Parser replaces then with the call of the content page the substitute symbols in the Template with the values from the content page. That looks then in such a way:

<HTML>
<HEAD>
<TITLE>my first homepage with phpCMS</TITLE>
</HEAD>
<BODY>
<H1>my first homepage with phpCMS</H1>
<P>
here is unnecessary talk, which is then inserted into the template.<BR>
you can use normal HTML tags for formatting. More intelligent it is however to use own TAGS to format a content.
</BODY>
</HTML>

As you can see: phpCMS is really easy to use!