Element.setLayout (Method)

Saves the selected layout type for an element.

Returns:

Void

Arguments:

Name Type Required Description
elementTypeID ElementTypeID Required The element type ID.
pageID PageID Required The unique ID of the page that the element resides on.
elementID ControlID Required An element's ID.
layoutID ID_NEG1_NEG2 Required The selected layout type which will either be the ID of a render handler, the ID of a display template, -1 for the Standard Rendering, or -2 for using default set for rendering the element type.
displayTemplateID DisplayTemplateID_0 Optional. Defaults to '0'. If the layout supports calling the standard handler, this is the ID of the display template to be invoked, or zero (0) for the standard rendering.

Context:

License Requirements (none)
Permission Requirements element:Design
Deny Context (none)
Require Context AuthoringEnabled
Author Lock Required
Transaction Logging If transaction logging is enabled at the site level, calls to this method will be logged
Customization This method may be customized at the site level

Error Codes:

Code Error Message
15024 The specified layout is inactive.
15026 The specified layout is not valid for the specified element.
15027 The specified layout does not support calling standard render module.

Notes:

None