beautypg.com

Dreamweaver.snippetpalette.getcurrentsnippetpath() – Adobe Dreamweaver API Reference CS5 User Manual

Page 335

background image

330

DREAMWEAVER API REFERENCE

Page content

Last updated 8/27/2013

Meta

Navigation

Text

Snippet files are XML documents, so you can specify the encoding in the XML directive, as shown in the following
example:

The following sample shows a snippet file:

preview="code" factory="true" type="wrap" >


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"

.