User Guide

Snippets panel functions 323
Snippets panel functions
Using Dreamweaver, web developers can edit and save reusable blocks of code in the Snippets
panel and retrieve them as needed.
The Snippets panel stores each code snippet in a CSN file within the Configuration/Snippets
folder. Snippets that come with Dreamweaver are stored in the following folders:
Accessible
Comments
Content_tables
Filelist.txt
Footers
Form_elements
Headers
Javascript
Meta
Navigation
Te xt
Snippet files are XML documents, so you can specify the encoding in the XML directive, as
shown in the following example:
<?XML version="1.0" encoding="utf-8">
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.
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 323 Wednesday, August 20, 2003 9:14 AM