Design Code
Validate Design Code
Validate a design code field without saving it. Handlebars template fields (custom_banner_code, custom_layout_code) are compiled against the registered helper set; syntax errors and unknown helpers are reported with line numbers. The CSS, header, and footer fields always pass. Validation is compile-level only — partials and helper calls without arguments can still fail at render time, so check the rendered blog page after saving. Requires editor permission or higher on the blog.
post/blogs/design-code/validate
Request body
Example request
{
"field": "custom_banner_code",
"code": "<div class=\"banner\">{{blog.title}}</div>"
}Response
Validation completed. Check data.valid for the result.
Example response
{
"data": {
"valid": true,
"errors": [
{
"line": 3,
"message": "You specified knownHelpersOnly, but used the unknown helper foo"
}
]
}
}Changes
No recorded changes to this endpoint across all 1 revision of this API.