thincms_update_template
Update a site's template by modifying only the provided fields: page frame (must include {{content}}), stylesheet, or custom head HTML. Use file paths for large files (>10KB) instead of inline content.
Instructions
Update the site's template. Only provided fields are changed. The pageFrame must contain {{content}} if provided. For large files (>10KB), use the File variants instead of inlining content. Available template tags: {{content}}, {{nav:header}}, {{nav:footer}}, {{site:name}}, {{site:tagline}}, {{site:logo}}, {{year}}, {{search:form}}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| siteId | No | Override the active site for this single call. Pass to target a specific tenant without mutating shared active-site state — the right pattern when running concurrent agent sessions managing different tenants. Must match a siteId from your THINCMS_SITES config (use thincms_list_sites to inspect). When omitted, the call uses the active site set by thincms_switch_site. | |
| pageFrame | No | HTML page frame with template tags (must include {{content}}) | |
| stylesheet | No | CSS stylesheet for the public site | |
| pageFrameFile | No | Local file path containing the page frame HTML. Use instead of pageFrame for large files. | |
| customHeadHtml | No | Custom HTML injected into <head> (fonts, meta tags, etc.) | |
| stylesheetFile | No | Local file path containing the CSS stylesheet. Use instead of stylesheet for large files (>10KB). | |
| customHeadHtmlFile | No | Local file path containing custom head HTML. Use instead of customHeadHtml for large files. | |
| confirmProductionWrite | No | Acknowledge that this call may write to a configured production site (THINCMS_PRODUCTION_SITE_IDS env var). Required for any POST/PUT/PATCH/DELETE against a production-listed site; ignored otherwise. The error message lists which site triggered the requirement and recommends thincms_snapshot before any production write. |