To see a list of available snippets, open the Snippets tab in the Resource browser on the left-hand side of the program. When you select a snippet name from the top pane, the code will appear in the bottom pane. All the built-in snippets come with a detailed HTML comment explaining what the code does.
Use any one of the following options to insert a snippet into your page:
- Double-click its name.
- Select it and click the Insert Item Into Current Document icon in the Code Snippets toolbar.
- Right-click it and select Insert Item Into Current Document.
- Drag it onto your page.
To create a snippet, highlight the text you would like to save as a snippet and use one of the following options to open the Save Snippet window:
- Go to File > Save Selected Text as Snippet.
- Click the Save icon in the Toolbar and select Save Selected Text as Snippet.
Name the snippet and click OK. The new snippet will be added to the list in the Code Snippets tab.
You can also add a new snippet using the options in the Code Snippets tab:
- Click the New Snippet icon in the Code Snippets toolbar.
- Right-click a snippet and select New Snippet.
Both of these options open a new tab in the HTML Editor workspace. When you are done entering the snippet text, save the document normally. This opens the Save Snippet window.
To edit an existing snippet, select it and click the Edit Snippet icon in the Code Snippets toolbar. This opens the snippet code in a tab in the HTML Editor workspace. Edit it and then save it normally.
To delete an existing snippet, right-click it and select Delete Snippet, or use the keyboard shortcut Del key. This opens a window asking if you are sure you want to delete the snippet. If you change your mind about deleting the snippet, click No.
Refreshing the Code Snippets Tab
If you have added, edited, or deleted a snippet but haven't seen the changes in the Code Snippets tab, click the Refresh icon in the Code Snippets toolbar. This refreshes the area so you can see the most up-to-date snippets.