docs: documenta get_layout_field/set_layout_field para header/footer/CSS/JS global
gitleaks / gitleaks (push) Canceled after 0s
gitleaks / gitleaks (pull_request) Canceled after 0s

acai-write/acai-line-replace rechazan custom-header-twig/custom-footer-twig con
'Forbidden path' y no habia ninguna doc que explicara por que ni el flujo real
(layout.json via get_layout_field/set_layout_field). Costo una sesion de
diagnostico en produccion (turismo.webserver2.plandeweb.com, Raul).
This commit is contained in:
2026-09-18 14:45:18 +01:00
parent 05d4be1af0
commit cf7dc93bc4
2 changed files with 24 additions and 0 deletions
+22
View File
@@ -89,6 +89,28 @@ Use `<set>` tag to create variables from queries:
<set :featured="'productos' | get({destacado: 1}, 'orden ASC', 3)"></set>
```
### Header, footer, and site-wide style/JS — NOT regular files
`template/estandar/modulos/custom-header-twig/index-base.tpl` and the equivalent `custom-footer-twig`
one are **not editable as files** — `acai-write`/`acai-line-replace` reject them with
`"Forbidden path: ... es un artefacto generado del layout global"`. They're special general sections
(the header/footer of the **entire site**). The `.tpl` on disk is only a generated copy for fast reading
(`acai-view` works fine on it), but the real source lives in `layout.json` and is edited with the
`get_layout_field`/`set_layout_field` MCP tools (see
[docs/mcp-tools-reference.md](mcp-tools-reference.md)):
- `field: 'header'` / `field: 'footer'` — the header/footer templates themselves.
- `field: 'style'` — global CSS for the whole site.
- `field: 'javascript'` — global JS for the whole site (delegated listeners shared by every page live
here, not in any `.js` file in the repo — a `grep` of the repo for "how does X work in the header"
can find nothing even though X works fine in production).
Workflow for a header/footer/global-CSS/global-JS change: `get_layout_field({field: '...'})` → edit the
**full** string (there's no line-replace for this — `set_layout_field` is a destructive full-content
replace) → `set_layout_field({field: '...', content: ...})`. The response includes `compile_ok` —
verify it, same as any other write-op (see the reliability warning in
[docs/mcp-tools-reference.md](mcp-tools-reference.md)).
## Repeatable Content (multiv2)