Skip to main content

Templates

Scene templates are reusable episode structures — a named collection of scenes and blocks that can be applied to a new episode to pre-populate its structure. They are distinct from the assignment template (which manages creator roles and stages).

Data model​

Template​

FieldTypeDescription
idnumberPrimary key
namestringDisplay name
descriptionstringWhat kind of episodes this template suits
isActivebooleanWhether the template is available for use

TemplateScene​

FieldTypeDescription
templateIdnumberParent template
titlestringScene title placeholder
ordernumberPosition in the template

TemplateBlock​

FieldTypeDescription
templateSceneIdnumberParent scene
typedialog | actionBlock type
ordernumberPosition in the scene
placeholderstringHint text for the writer

Applying a template​

When a user applies a template to an episode, the backend clones all template scenes and blocks (with type and order preserved) into real scene and scene_block records linked to the episode. Existing scenes in the episode are not affected.

GET /templates vs GET /templates/all​

  • /templates — returns only isActive = true records (what users see)
  • /templates/all — returns all records including archived ones (admin view)

Permission scopes​

ScopeWhat it guards
TEMPLATE_CREATECreating a template
TEMPLATE_EDITEditing template metadata, scenes, and blocks
TEMPLATE_DELETEDeleting a template