Template

Update an existing template

Changed on

Saves a new working version of an existing template. The form must contain the template identifier. The 'theme' field in the form corresponds to the theme folder identifier (referred to as 'themeId' in other endpoints). Returns 404 if the template does not exist.

When drawed is true: body is REQUIRED and non-empty (else 400 'body required when drawed'), and theme MUST resolve to a theme folder identifier (else 400 'theme must be a folder identifier'). Include drawedBody (the layout JSON) so the template stays a real drawn template.

For a themed drawn template, body is a generated compatibility shell and is not used to assemble the rendered page; the theme's template.vtl and drawedBody are authoritative. A persisted /themes/null/ reference in that shell is benign, and changing body does not repair or affect themed drawn rendering because the server regenerates it.

put/api/v1/templates

Request

Request body

siteIdstring

Identifier of the site (host) where this template will be created. This is a site identifier UUID, not 'hostId'. If not provided, the template is assigned to the site resolved from the current HTTP request context.

identifierstring

Identifier of the template. Required for updates, ignored on creation.

inodestring

Inode (version identifier) of the template. Server-managed; typically omitted on input.

bodystring

Raw Velocity markup that renders the template. Required even when 'drawed:true' — send an empty string ('') when using the layout builder ('layout') instead of hand-written body.

selectedimagestring

Identifier of the image asset currently selected as the template thumbnail in the UI.

imagestring

Identifier of the image asset used as the template thumbnail.

drawedboolean

Whether this template was built with the visual layout builder. When true, provide 'layout' (the row/column/container structure); when false, provide 'body'.

showOnMenuboolean

Whether this template should appear in navigation menus.

drawedBodystring

Velocity body generated by the layout builder for a drawn template. Server-managed.

countAddContainerinteger

Count of 'add container' placeholders in the layout. Server-managed; typically omitted.

countContainersinteger

Count of containers in the layout. Server-managed; typically omitted.

headCodestring

Velocity/HTML injected into the page <head> for pages using this template.

themestring

Theme folder identifier (not a path) that supplies the template's CSS/JS and VTL fragments. Resolve the folder identifier from a path via GET /api/v1/folder/sitename/{site}/uri/{uri}.

themeNamestring

Display name of the theme. Informational; 'theme' (the folder identifier) is authoritative.

footerstring

Velocity/HTML footer fragment for pages using this template.

friendlyNamestring

Friendly (human-readable) name of the template.

headerstring

Velocity/HTML header fragment for pages using this template.

namestring

Internal/asset name of the template.

titlestring required

Title of the template (displayed in the UI).

sortOrderinteger

Sort order for display purposes.

headerCheckboolean

Whether the header fragment is enabled for this template.

footerCheckboolean

Whether the footer fragment is enabled for this template.

Response

Template updated successfully

i18nMessagesMapobject
permissionsstring[]

Changes

    • breaking

      request body became required

    • breaking

      removed the media type */* from the request body

    • info

      api operation id save_3 removed and replaced with updateTemplate

    • info

      api tag Template added

    • info

      added the media type application/json to the request body

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the success response with the status