Template

Save and publish a template

Changed on

Saves and immediately publishes a template in a single operation. If the form contains an identifier, it updates the existing template; otherwise, it creates a new one. The 'theme' field in the form corresponds to the theme folder identifier (referred to as 'themeId' in other endpoints). Requires Publish permissions.

put/api/v1/templates/_savepublish

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 saved and published successfully

i18nMessagesMapobject
permissionsstring[]

Changes

    • breaking

      request body became required

    • info

      api operation id saveAndPublish removed and replaced with saveAndPublishTemplate

    • info

      api tag Template added

    • info

      added the new optional request property //////

    • info

      added the new optional request property ////

    • 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