de codex
This commit is contained in:
@@ -72,6 +72,10 @@ Patrón para colores configurables por el usuario:
|
||||
|
||||
JavaScript scopeado al módulo usando `section_id`:
|
||||
|
||||
This is the default and expected place for module JavaScript.
|
||||
Do NOT embed `<script>` tags directly inside `index-base.tpl` for normal module behavior.
|
||||
Keep `index-base.tpl` for HTML/Twig markup and put interactive logic in `script.js`.
|
||||
|
||||
```js
|
||||
const section = document.getElementById('{{ section_id }}');
|
||||
if (section) {
|
||||
@@ -88,6 +92,15 @@ CmsApi.hook('/hooks/module_id/', { action: 'getData', id: 123 }, function(respon
|
||||
});
|
||||
```
|
||||
|
||||
If you are calling a hook that belongs to the current module, the endpoint must use the real module id:
|
||||
|
||||
```js
|
||||
// Module folder: template/estandar/modulos/buscadorapartados_hjd8s/
|
||||
CmsApi.hook('/hooks/buscadorapartados_hjd8s/', { termino: 'vela' }, function(response) {
|
||||
console.log(response);
|
||||
});
|
||||
```
|
||||
|
||||
### Cuándo usar Vue 3
|
||||
|
||||
Usar Vue 3 CDN cuando la lógica requiera:
|
||||
|
||||
Reference in New Issue
Block a user