W3C Amaya

Using templates with Amaya

Introduction

A template is a model, or skeleton, of a document, which you may use while creating a new document. Since version 2.2, Amaya supports the use of templates stored locally in the user's workstation, or remotely in a server.

How it works

When you're opening a new document from the File/New Menu, Amaya can proposes you to either create a new document from scratch or use an existing template. If you choose the template, Amaya will open a new page and show you the available templates. Once you choose a template, Amaya will replace the templates index with the template and you may edit it.

The Special/Preferences/Templates menu allows you to specify the URL of the templates server. This server may be either local or remote to your workstation.

Using W3C's sample template server

Setup

The server is located at http://cgi.w3.org/cgi-bin/createform.pl. Use the Special/Preferences/Templates to type in the URL of the server: http://cgi.w3.org/cgi-bin/createform.pl. You may need to quit Amaya in order to activate the template options in the file Menu.

Making a new document from a template

Choose the File/New/From Template menu. This will open a new Amaya window with an index of templates.

Choosing a template

The following image represents the template index returned by W3C's sample template server:


Templates Stylesheets
 Resume
A template to help you create your on-line resume.

 Calendar
A template to conceive a calendar.

 Personal home page
A template to create your home page.

 W3C Note Template
A template to create a W3 Consortium note.

 W3C Recommendation Template
A template to create a W3 Consortium recommendation.

 W3C Working Draft Template
A template to create a W3 Consortium working draft.

 Black Red
Black background, white text, red centered headlines, green links.

 Blue
Light blue background, white text, blue dark headlines.

 White
White background, black text, blue headlines.

 Without stylesheet

Enter here the URL of the new document

Enter a complete URL like http://server_name/.../doc_name


This form allows you to select one template, an optional stylesheet, and optionally, give the final URL of the document you're going to create. After submitting the form, Amaya will replace the template index with the chosen template.

Saving a document made from a template

If you gave the URL of the new document from the template index, you'll only need to press the Save Button on the Amaya menu bar. Otherwise, you'll need to use the File/Save as menu. Note that your server must be configured to accept the HTTP PUT method.

Installing your own template server

You can either install and customize W3C's template server scripts or build your own. If you decide for the later and want to keep the choice of having the user type-in the URL of the new document, your templates must return this URL in the form of a META element:

<META name="AMAYA_TEMPLATE" content=URL>

Amaya will automatically remove this element from the document and change the destination URL to the specified value.

Note that this is a browser-dependent functionality and which is proposed as an experiment with templates, rather than as an official W3C recommendation.

Simulating a template server with a local file

You'll need to create a number of templates and an index file that points to them. Then, use the URL of your index file as the URL of the template server.

Note that you won't be able to profit from the dynamic aspects of the template server, such as changing the URL of the target document or selecting one among different stylesheets.

Authors and Contributors


José Kahan

Last modified $Date: 1999/10/26 11:14:54 $

Copyright  ©  1999 W3C (MIT, INRIA, Keio ), All Rights Reserved. W3C liability, trademark, document use and software licensing rules apply. Your interactions with this site are in accordance with our public and Member privacy statements.