You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fd96475
Browse filesBrowse the repository at this point in the historyBrowse files
@@ -700,6 +703,57 @@ setReplace(replace) | The replacement value. The replacement can be any valid JS
700
703
701
704
---
702
705
706
+
## Template Schemas
707
+
708
+
The following schemas specify how to use templates to store and render templates. A template lets you save an
709
+
[Edit](#edit) that can be rendered by its template ID and optionally include merge fields that are merged with the
710
+
template when rendered.
711
+
712
+
### Template
713
+
714
+
A template is a saved [Edit](#edit) than can be loaded and re-used.
715
+
716
+
#### Example:
717
+
718
+
```javascript
719
+
constShotstack=require('shotstack-sdk');
720
+
721
+
consttemplate=newShotstack.Template;
722
+
template
723
+
.setName('My Template')
724
+
.setTemplate(edit);
725
+
```
726
+
727
+
#### Methods:
728
+
729
+
Method | Description | Required
730
+
:--- | :--- | :---:
731
+
setName(string name) | The template name. | Y
732
+
setTemplate([Shotstack.Edit](#edit) edit)) | An edit defines the arrangement of a video on a timeline, an audio edit or an image design and the output format. | Y
733
+
734
+
### TemplateRender
735
+
736
+
Render a template by its id and optional merge fields.
737
+
738
+
#### Example:
739
+
740
+
```javascript
741
+
constShotstack=require('shotstack-sdk');
742
+
743
+
consttemplate=newShotstack.TemplateRender;
744
+
template
745
+
.setId('21e781c0-8232-4418-fec1-cc99f0280c21')
746
+
.setMerge(merge);
747
+
```
748
+
749
+
#### Methods:
750
+
751
+
Method | Description | Required
752
+
:--- | :--- | :---:
753
+
setId(string id) | The id of the template to render in UUID format. | Y
754
+
setMerge([Shotstack.MergeField[]](#mergefield) mergeField) | An array of key/value pairs that provides an easy way to create templates with placeholders. The placeholders can be used to find and replace keys with values. For example you can search for the placeholder `{{NAME}}` and replace it with the value `Jane`. | -
755
+
756
+
---
703
757
## Output Schemas
704
758
705
759
The following schemas specify the output format and settings.
0 commit comments