Editing snippet items
This documentation describes how to modify the template code that is in an item in a drawer in the Snippets view.
To modify an existing item in a Snippets drawer, complete the steps listed below. If you have just completed the task Adding an item to a snippets drawer and the Customize Palette window is still open, you can skip steps 1 and 2.
- In the Snippets view, right-click the name of the item that you want to modify, and select Customize.
- Optionally, type a new name and a new description for the item.
- To declare a variable, click New and type the variable's name, description, and default value.
- To edit an existing variable, type over the existing values.
- To edit the Template Pattern field, type into the field, cut and paste into the field, or, if you have defined one or more variables, click the Insert Variable Placeholder button, and double-click the name of the variable that you want to insert. For example, if you have declare variables named uri and prefix, clicking the button brings up a menu that contains those names. Double-clicking uri inserts ${uri}, as in the following example:
<%@ taglib uri="${uri}" prefix="${prefix}" %>Later, when you insert the snippet into a file, ${uri} and ${prefix} are each converted to the default value declared in the Variables table. Users can replace the default values in the Insert Template:Item_name dialog at insertion time.- Click OK.
The modified item will be added to the list of items in the appropriate drawer.
Related concepts
Snippets view
Related tasks
Editing with snippets - overview
Adding snippets drawers
Adding items to snippets drawers
Deleting or hiding snippet items or drawers