Description
Applies a CSS-based layout to the document. The document body must be empty, and the document must be a page
where you can apply a layout. That is:
• A page that is HTML based, such as HTML, XHTML, ColdFusion, PHP, and so on, (but not CSS, XML, JavaScript,
and so on).
• A page that is not a frameset or a template instance (although a template itself is fine).
Arguments
,
layout-index
CSS, cssFileName, preventOverwrite
•
is an integer, zero-based index that specifies the layout to use. This is an index to the list of layouts,
layout-index
which is used to return the
•
specifies where to put the CSS layout. Possible values are:
CSS
• "
" - embed the CSS in the document head.
embed
• "
" - link to
link
cssFileName
• "
" - write CSS in
create_and_link
• "
"- import
import
cssFileName
• "
create_and_import
•
cssFileName is the
•
is a Boolean value, where:
preventOverwrite
: when creating a new css file, fail if the file already exists
true
: overwrite the file if it already exists
false
Returns
A Boolean value where:
: layout is successfully applied
true
: layout is not successfully applied
false
Example
dw.getLayoutNames();
var theDOM = dw.getDocumentDOM();
alert (theDOM.canApplyLayout());
if (theDOM.canApplyLayout())
theDOM.applyLayout(1, "embed");
else
alert("can't apply layout to this doc");
dom.canApplyLayout()
Availability
Dreamweaver CS3.
Description
Checks whether a CSS-based layout can be applied to the document. It checks that the document body is empty, and
that it is a page where you can apply a layout. That is:
and
layoutNames
layoutDescriptions
.
cssFileName
.
" - write CSS in
cssFileName
name of the CSS file to link or import and create, if appropriate.
in the corresponding functions.
and link to that.
and import.
DREAMWEAVER CS3
333
API Reference