4.2 KiB
4.2 KiB
Pages & Records Guide
Page Types
Every CMS record that has an enlace (URL) field is a page. Pages come in two types determined by the controlador field:
Builder (Modular) Pages
controlador=cms/lib/plugins/builder_saas/controlador.php- Content is built from modules (drag & drop components)
- The
builderfield contains a JSON array of module instances - Use MCP tools:
add_module_to_record,set_module_config_vars, etc. - The page template renders modules in order from the builder JSON
Standard Pages
controlador=cms/lib/plugins/builder_saas/controlador_tabla.php- Content lives directly in the record fields (
content,titulo_alternativo, etc.) - The
contentfield is HTML (wysiwyg) - Use
create_or_update_recordto edit content directly - No modules involved
How to determine page type
Always check the controlador field of the record:
- Contains
controlador.php(without_tabla) → Builder - Contains
controlador_tabla.php→ Standard
Table Types (Sections)
Tables with pages are called sections. There are two section types defined by menuType in the schema:
Category (menuType = "category")
- Hierarchical — pages have parent/child relationships
- Fields:
parentNum,depth,globalOrder,lineage,siblingOrder - Example:
apartados(main site pages) - Uses
visible_en_el_menufield for menu visibility - Ordered by
globalOrder
Multi (menuType = "multi")
- Flat list — no hierarchy
- Uses
dragSortOrderfor ordering - Example:
blog,travesias - Typically uses
visiblefield (notvisible_en_el_menu)
Critical Rules for Pages
NEVER change the enlace field
Unless the user explicitly asks to change a page URL, never modify the enlace field. Changing it breaks existing links, SEO, and navigation. The enlace is set when the page is created and should remain stable.
NEVER change the controlador field
The controlador defines whether the page is Builder or Standard. Changing it breaks the page rendering. Only set it during page creation.
Visibility fields
apartadosand other category tables use:visible_en_el_menu(1 = visible, 0 = hidden)blog,travesiasand other multi tables use:visible(1 = visible, 0 = hidden)- Always check which field the table has before toggling visibility
Name/Title fields
- Some tables use
name(e.g.apartados) - Others use
title(e.g.blog,travesias) - Check the schema to know which one to use
Working with Builder Pages
Adding content to a new Builder page
- List available modules:
list_available_modules - Add modules:
add_module_to_record(one at a time, in order) - Configure each module:
set_module_config_varswith content - Add images if needed:
upload_record_imageorgenerate_image
Editing an existing Builder page
- List current modules:
list_page_modules - Get module vars:
get_module_config_vars - Update vars:
set_module_config_vars - Or edit the module template: edit
index-base.tpl→compile_module
Working with Standard Pages
Adding content to a Standard page
Use create_or_update_record to set:
content— HTML content (main body)titulo_alternativo— alternative title shown on the pagetitulo_de_pagina— browser tab title (SEO)metatag_descripcion— meta description (SEO)
Example: Update a standard page
create_or_update_record with:
tableName: "apartados"
recordNum: "87"
fields:
content: "<h2>Our Services</h2><p>We offer...</p>"
titulo_de_pagina: "Services | My Site"
metatag_descripcion: "Discover our services..."
The apartados Table (Special)
The apartados table is the main pages table in most Acai sites. Key characteristics:
menuType = "category"— hierarchical with parent/childparentNum— the num of the parent page (0 = root level)depth— nesting level (0 = root, 1 = child, 2 = grandchild)globalOrder— display order across the entire treevisible_en_el_menu— whether the page shows in the navigation menubreadcrumb— auto-generated breadcrumb path- Pages can be either Builder or Standard (check
controladorfield per record)