# Creating a new document - templates

In the HTML menu there are two functions New Document... and New with Content.... They have the same functionality with the only difference that the second one creates a new HTML document with the content of the current window. To create a new document with a FRAMESET element use New Doc. with Frames in the Frames menu.

You are first asked to choose a template for the new document, and to give the new document a name. How do you choose a template?

- To each home page folder you can optionally specify a template folder containing all templates for that home page.
- To select the template you want first select the right home page in the top popup menu.
- The second popup menu is now modified to contain the names of all text files in the template folder of the home page you have chosen.
- Now pick a template from the second popup menu. Note! Using a template is optional.

A new window is now opened and the template is inserted. Then a second dialog box is then opened where you can:

- give the document a title,
- choose elements to insert in the documents HEAD,
- insert a document type declaration,
- specify the encoding in the XML declaration when XHTML is used.

Alpha now inserts the elements HTML, HEAD, TITLE, BODY, and the ones you have checked in the dialog box into the document asking you about attributes for them. If these elements already appear in the template, their attributes are used as default values.

Where does the content go when using New with Content? In this case Alpha looks for the string #CONTENT# in the template. If there is such a string it is replaced by the content. If there is no such string the content is put right before the closing BODY tag.

## A template example

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Default title</TITLE>
<LINK HREF="mystyle.css" REL="stylesheet">
</HEAD>
<BODY BACKGROUND="bg.jpg">
#CONTENT#
</BODY>
</HTML>

In this example "Default title" which be used a the default for the window's title in the above dialog box. "Bg.jpg" will be used as the default value for the background attribute.

Tip! Put template stops (•) in your templates. Alpha will automatically jump to the first one.

Previous page Next page