blob: c475e981c844bab5be30ca25120e3a5455e46945 [file] [log] [blame]
kprice159fa582006-05-08 21:30:45 +00001<?xml version="1.0" encoding="utf-8"?>
2<!--Arbortext, Inc., 1988-2005, v.4002-->
3<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
4 "..\dtd\task.dtd">
5<task id="tsrcedt024" xml:lang="en-us">
6<title>Adding and removing HTML templates</title>
7<shortdesc>HTML content assist provides several templates, or chunks of predefined
8code, that you can insert into a file. You can use the default templates as
9provided, customize the default templates, or create your own templates.</shortdesc>
10<prolog><metadata>
11<keywords><indexterm>HTML<indexterm>templates<indexterm>removing</indexterm></indexterm></indexterm><indexterm>templates<indexterm>HTML</indexterm></indexterm><indexterm>HTML<indexterm>templates<indexterm>adding</indexterm></indexterm></indexterm>
12
13
14
15
16</keywords>
17</metadata></prolog>
18<taskbody>
19<context> <p>For example, you may work on a group of HTML pages that should
20all contain a table with a specific appearance. Create a template that contains
21the tags for that table, including the appropriate attributes and attribute
22values for each tag. (You can copy and paste the tags from a structured text
23editor into the template's <uicontrol>Pattern</uicontrol> field.) Then select
24the name of the template from a content assist proposal list whenever you
25want to insert your custom table into an HTML or XHTML file.</p><p>To add
26a new HTML template, complete the following steps:</p> </context>
27<steps>
28<step><cmd>From the <uicontrol>Window</uicontrol> menu, select <uicontrol>Preferences</uicontrol>.</cmd>
29</step>
30<step><cmd>In the Preferences page, select <menucascade><uicontrol>Web and
31XML</uicontrol><uicontrol>HTML Files</uicontrol><uicontrol>HTML Templates</uicontrol>
32</menucascade>.</cmd></step>
33<step><cmd>Click <uicontrol>New</uicontrol>. </cmd></step>
34<step><cmd>Enter the new template name (a text string) and a brief description
35of the template.</cmd></step>
36<step><cmd>Using the <uicontrol>Context</uicontrol> drop-down list, specify
37the context in which the template is available in the proposal list when content
38assist is requested.</cmd></step>
39<step><cmd>In the <uicontrol>Pattern</uicontrol> field, enter the appropriate
40tags, attributes, or attribute values (the content of the template) to be
41inserted by content assist.</cmd></step>
42<step><cmd>If you want to insert a variable, click the <uicontrol>Variable</uicontrol> button
43and select the variable to be inserted.</cmd><stepxmp>For example, the <varname>word_selection</varname> variable
44indicates the word that is selected at the beginning of template insertion,
45and the <varname>cursor</varname> variable determines where the cursor will
46be after the template is inserted in the HTML document.</stepxmp></step>
47<step><cmd>Click <uicontrol>OK</uicontrol> to save the new template.</cmd>
48</step>
49</steps>
50<postreq><p>You can edit, remove, import, or export a template by using the
51same Preferences page. If you have modified a default template, you can restore
52it to its default value. You can also restore a removed template if you have
53not exited from the workbench since it was removed.</p><p>If you have a template
54that you do not want to remove but you no longer want the template to appear
55in the content assist list, go to the Templates preferences page and uncheck
56its check box.</p></postreq>
57</taskbody>
58<related-links>
59<linkpool type="concept">
60<link href="csrcedt004.dita"><linktext>Structured text editors for markup
61languages</linktext></link>
62</linkpool>
63<linkpool type="task">
64<link href="tsrcedt027.dita"><linktext>Adding and removing markup language
65templates - overview</linktext></link>
66<link href="tsrcedt028.dita"><linktext>Adding and removing JSP templates</linktext>
67</link>
68<link href="tsrcedt029.dita"><linktext>Adding and removing XML templates</linktext>
69</link>
70<link href="tsrcedt000.dita"><linktext>Editing text coded in markup languages
71- overview</linktext></link>
72</linkpool>
73</related-links>
74</task>