Refine hooks distinction, add assets/, rename twig-filters

- Clarify module hook vs file hook: when to use each, different call URLs
- Add schema path (cms/data/schema/) to reglas importantes
- Add assets/ and hook.php to module file structure
- Fix variable assignment example: use string syntax for get()
- Rename twig-filters.md → twig-reference.md (covers more than filters)
- Move Global Variables from modular-system.md to twig-reference.md
- Update all references in CLAUDE.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-26 11:42:15 +00:00
parent 39661ad0da
commit ed35d4e313
4 changed files with 52 additions and 24 deletions

View File

@@ -14,6 +14,8 @@ Modules are the visual building blocks of Acai websites. Each module lives in `t
├── builder.json # Compiled builder vars (auto-generated, do NOT edit)
├── style.css # Module-scoped styles
├── script.js # Module JavaScript
├── hook.php # Module hook (optional — only if this module needs server-side logic)
├── assets/ # Vue components and other JS assets for this module
└── minified/
├── script-{hash}.js # JS minificado (servido al browser, do NOT edit)
└── style-{hash}.css # CSS minificado (servido al browser, do NOT edit)
@@ -48,13 +50,7 @@ Parameters are received as variables inside the included module.
### Global Variables
| Variable | Description |
|----------|-------------|
| `section_id` | Unique ID per module instance (use for anchors, JS scoping) |
| `interno` | `true` when viewing in CMS editor, `false` on public site |
| `server.HTTP_HOST` | Current domain |
| `loop.index` | 1-based iteration index (inside `c-for`) |
| `loop.index is odd` / `loop.index is even` | For alternating layouts |
See [twig-reference.md — Global Variables](twig-reference.md#global-variables) for the full list of variables available in all templates.
## General Sections
@@ -89,7 +85,7 @@ Use `<set>` tag to create variables from queries:
```html
<set :categories="'categorias' | get()"></set>
<set :featured="'productos' | get({destacado: 1}, 'orden ASC', 3)"></set>
<set :featured="'productos' | get('destacado=1', 'orden ASC', 3)"></set>
```