Template
A Template is reusable Content with variables, filled from Things in the graph and authored as MDX, rendering a Message, Document, or Page.
- Read as
- GuideSpec
A Template is an inheritable Startup definition that a new Startup extends, overriding anything it inherits.
Properties
| Property | Type | Required | Description |
|---|---|---|---|
body | text | required | The MDX source with its variables. |
Object
{
"$id": "https: //api.sb/ tutorloop.com/ templates/ template_1",
"$type": "Template",
"body": "Example body"
}Relationships
- A Template generates many Documents: a Template fills its variables from the graph to generate a Document, such as a proposal or an invoice.
generates, inversegeneratedFrom. - A Template places many Components: a Template places named Components, such as
Pricing, and fills their props from records.places, inverseplacedBy. - A Template renders many Pages: a Template fills one Page per Thing or per member of a Collection.
renders, inverserenderedWith.
Verbs
createCreates a Template.POST /{namespace}/templatesgetReturns one Template by id.GET /{namespace}/templates/{id}listReturns Templates, newest first, one page at a time.GET /{namespace}/templatesupdateChanges the given properties of a Template.PATCH /{namespace}/templates/{id}deleteDeletes a Template; its history is kept.DELETE /{namespace}/templates/{id}extendExtend adds a Template to a Startup’s bases, pinned to a Version, so the Startup inherits its definition.POST /{namespace}/templates/{template}/extendpromotePromote moves one Startup’s refinement into a Template, so every Startup that extends the Template inherits it.POST /{namespace}/templates/{template}/promoteupgradeUpgrade moves a Startup to a newer Version of a Template it extends, through a Change it can review.POST /{namespace}/templates/{template}/upgrade
Permissions
Which Access level may call each Verb. One-way Verbs wait their delay window.
| Operation | owner | admin | member | viewer |
|---|---|---|---|---|
Template.create | Yes | Yes | Yes | No |
Template.get | Yes | Yes | Yes | Yes |
Template.list | Yes | Yes | Yes | Yes |
Template.update | Yes | Yes | Yes | No |
Template.delete | Yes | Yes | Yes | No |
Template.extend | Yes | Yes | Yes | No |
Template.promote | Yes | Yes | Yes | No |
Template.upgrade | Yes | Yes | Yes | No |
Call it
Extend the latest template with a startup.Example
A Startup that sells a collections Agent extends the Agent as a Service Template, then overrides the default Price to $150 a month.