User Guide

392 Page Content
The following sample shows a snippet file:
<snippet name="Detect Flash" description="VBscript to check for Flash
ActiveX control" preview="code" factory="true" type="wrap" >
<insertText location="beforeSelection">
<![CDATA[ ------- code --------- ]]>
</insertText>
<insertText location="afterSelection">
<![CDATA[ ------- code --------- ]]>
</insertText>
</snippet>
Snippet tags in CSN files have the following attributes:
You can use the following methods to add Snippets panel functions to your extensions.
dreamweaver.snippetPalette.getCurrentSnippetPath()
Availability
Dreamweaver MX 2004.
Description
Returns the path to the snippet that is currently selected in the Snippets panel.
Arguments
None.
Returns
The path, relative to the Snippets folder, to the snippet selected in the Snippets panel. Returns
an empty string if no snippet is selected.
Attribute Description
name
Name of snippet
description
Snippet description
preview
Type of preview: "code" to display the snippet in preview area or
"design" to display the snippet rendered in HTML in the Preview
area.
type
If the snippet is used to wrap a user selection, "wrap"; if the
snippet should be inserted before the selection,
"block".
000_DW_API_Print.book Page 392 Wednesday, July 20, 2005 11:58 AM