Using SnippetsSnippets Basics and OperationsSnippets are named pieces of text, such as meta tags, HTML tags, standard headers and footers, plain text, JavaScript, and SQL. Snippets are a good way of saving text, HTML markup, or other commands that you use frequently. You can insert snippets into most text fields throughout Tango Editor. Tango Editor comes with a large defined set of snippets and also lets you create your own snippets. This chapter discusses how to: ![]() About SnippetsSnippets are used to quickly access text, meta tags, and HTML that you use often. You use snippets by dragging them into an editing window or double clicking on a snippet when you have an HTML editing window open. A special feature of snippets lets you surround a selection of text with tags or meta tags, in addition to putting text, tags, or meta tags at a particular place. Your snippets are saved as text files within the My Snippets folder inside the Windows/your_login folder (under Windows 95) or inside the WinNT/Profiles/your_login folder (under Windows NT). You can edit Tango snippet files with a text editor or HTML editor, or edit them within the Snippets workspace. The Snippets WorkspaceYou manipulate and manage snippets in the Snippets Workspace. To display the Snippets WorkspaceOpen the Workspace window by choosing Workspace from the View menu and click the Snippets tab. You expand a folder by clicking the "+" sign to view its contents. Folders and snippets appear alphabetically. |
|
|
|
For
more information, see "Shortcuts to Configuration Variable
Assignments: Snippets".
|
Context-Sensitive Menus in the Snippets WorkspaceYou can access a variety of commands when you right click items in the Snippets Workspace. There are two different context sensitive menus: one for folders, and one for snippets. In both menus, the Workspace commands--Allow Docking and Hide--are always active.
![]() Working With SnippetsInserting SnippetsTo insert a snippet into an application file
You can select and drag several snippets at the same time. To drag multiple snippets
Creating SnippetsTo create a snippet with existing textDrag text to a folder in the Snippets workspace. A snippet is created containing the text you dragged. The name of the new snippet defaults to "Untitled" and is editable. Type in a new name. To create a snippet with new text
Using Placeholders in SnippetsWhen you right click the Snippet contents window, the Insert Placeholder command is listed in the context-sensitive menu that appears, in addition to the standard Tango editing commands. Insert Placeholder inserts a special symbol--the yen symbol, ¥--into the Snippet contents window. This placeholder character allows you to create snippets that put HTML or meta tags around text you select before inserting the snippet. For example, you can create a snippet of the following text: To use this snippet while editing HTML, you would select the text you want to apply the <H1> format to, and then drag the snippet into the editing window or double click the snippet. The selected text is surrounded by the <H1> and </H1> tags. Editing SnippetsTo edit the contents of a snippet
Creating a Snippets FolderYou can create new folders for holding your snippets in the My Snippets folder. This feature is useful if you want to categorize your snippets by type (for example, meta tags, SQL, HTML, and text snippets). To create a new folder in the My Snippets folder
Renaming Snippets and Snippet FoldersTo change the name of a snippet or snippet folder
The name of the snippet or snippet folder becomes editable; type in the new name.
Copying, Moving, and Deleting SnippetsTo copy a snippet to the My Snippets folder for editing Drag the snippet from the Standard Snippets, Configuration Variables or Column Snippets folders to the My Snippets folder. You can move snippets to a different folder within the My Snippets folder by dragging snippets to their new location. To duplicate a snippet within the My Snippets folderHold down the Ctrl key, and drag the snippet. To delete a snippet or snippet folder |
Click the snippet or snippet folder, and do one of the following:
A dialog box asking you if you want to delete the snippet appears. Click OK.
You can delete multiple snippets. Choosing Delete from the right click menu deletes the selected snippets. Snippet PropertiesTo see the properties of a snippet or snippet folderSelect the snippet or snippet folder, and do one of the following
The Snippet Properties or Snippet Folder Properties dialog box appears: These dialog boxes list the name and location of the snippet or snippet folder, and the size of the snippet. Column SnippetsThe Column Snippets area of the Snippets workspace becomes active when the following are displayed: The Search action's Select columns appear (and the Snippets tab is switched to and the Columns Snippets folder expanded, if necessary). (The Search action appears in the actions generated by the New Record Builder and Search Builder, as well as a separate action.) |
|
For more information, "<@COLUMN>" in the Meta Tags and Configuration Variables manual. |
The content of each snippet is <@COLUMN name>, where the column name is the name from the Search action or New Record Builder you are editing. |
Copyright © 1998, Pervasive Software Inc. All rights reserved.