Path in the Gestor modulos/publisher-pages/
Creates publications from publisher definitions. Each publication is a page in paginas, accompanied by structured values and template HTML in publisher_pages. The populated HTML is saved on the page for runtime use.
How to use
-
Open
publisher-pages/and filter by publisher. The initial filter istipo=pagina; system/both type, module andpublisher_idfilters are also available. -
Use
publisher-pages/adicionar/?publisher_id=<slug>to select the definition. Fill in name, path, layout and publisher fields. The interface supports text, textarea, HTML through Quill and images through the file picker. -
Review the template and preview. The browser builds populated HTML; textarea line breaks become
<br>, images receive the root and HTML uses Quill content. -
Configure SEO, featured image and dates; changing
sem_permissaorequires operationpermissao-pagina. -
Save. Edit:
publisher-pages/editar/?id=<slug>; clone:publisher-pages/clonar/?id=<slug>. Routes stay identical in pt-br/en JSON, relative to the language root. -
To change publication type, use the Move Publication modal, select the destination and confirm. Review fields and design afterward: there is no automatic conversion to the destination template.
JS combines the user prefix, publisher prefix and normalized path, removing prefixes already present to avoid duplication. Selecting a publisher may reload the screen; save your work before switching context.
Technical reference
Operations, permissions and hooks
The controller configures listar and dispatches adicionar, editar, clonar. Status/deletion are shared-interface operations with sitemap callbacks. The listing requires publisher_id IS NOT NULL, not a mandatory JOIN with publisher_pages.
Module AJAX:
| Case | Input/result |
|---|---|
editor-html-switch |
editor_checked=sim enables the module boolean variable; other values disable it; returns status=Ok |
mover-publicador |
page_id (fallback ajaxRegistroId) and new_publisher_id; returns Ok with message/redirect or Error with message |
The operation seed declares modificar-permissao-do-publicador-da-pagina, operation permissao-pagina. The backend checks it before writing sem_permissao. The move handler has no additional local check for a dedicated operation: it depends on authorization by the calling interface.
Filter hook_apply_filters('publisher-pages', 'listar.publisher-select', $publisher) allows changing the publisher list. This JSON has no hooks.api or hooks subscriptions, and there is no public widget of its own. Publication templates belong to publisher, target publisher; this module's resources supply screens and field fragments.
Tables and value format
The main CRUD table is paginas: id, name, path, layout, content, CSS, permission, status, dates and SEO follow the admin-paginas contract. paginas.publisher_id is a string up to 255.
publisher_pages column |
Type/contract |
|---|---|
id_publisher_pages |
Numeric key |
page_id, publisher_id |
Required strings up to 255, expanded by the July 2026 migration |
language |
String up to 10, default pt-br |
fields_values |
Nullable JSON |
html_template |
Nullable MEDIUMTEXT |
There is a unique (page_id, language) index and publisher/language indexes. This table has no status, version or dates of its own; those belong to the page.
[
{"id":"title","value":"My publication"},
{"id":"content","value":"<p>Article text.</p>"},
{"id":"featured_image","value":"uploads/cover.webp"}
]Ids come from publisher.fields_schema.fields. On submission, publisher_fields_schema describes the fields; PHP reads field_<id> or field_<id>-caminho for images. JSON is encoded with unescaped Unicode and slashes, then escaped for SQL.
Submitted html preserves template markers in publisher_pages.html_template; htmlWithValues becomes paginas.html. On creation/cloning, nonempty editor HTML is preserved. When empty, helpers try to recover HTML from an active template of an active publisher. This fallback only supplies structure: it does not itself substitute custom values on the server.
CSS, editing and dates
Creation/cloning can inherit templates.css_precompiled. publisher_pages_css_derivado() returns this CSS and its signature, calculated from final HTML/CSS, template CSS, layout CSS and compiler version. Without precompiled template CSS, both are empty. The editor also submits css_compiled and html_extra_head.
Editing updates the page and structured data separately; renaming may generate a new slug and update page_id. It records history/backups and marks version/modification origin. Path changes register a 301 and update the sitemap; sitemap exceptions do not abort saving. SEO includes social title/description, meta description/keywords and image path.
Dates use the shared converter and router publication window described in admin-paginas. There is no draft/review/approval workflow in this controller. Creation saves status A.
Moving publishers
The handler requires an existing, nondeleted page and destination in the language, rejects the same publisher and checks collisions when the path changes. Inactive destinations are accepted because the query uses status!='D'.
It only replaces the prefix when the old prefix is nonempty and matches the path start, case-insensitively. Otherwise it preserves the URL. It updates paginas.publisher_id and publisher_pages.publisher_id, the page's version/date/user_modified, history and, when the path changes, 301/sitemap. It does not remap fields_values or replace html_template, published HTML or CSS.
Defects and legacy discrepancies
Old Portuguese documentation used nonexistent names such as publicador_paginas and a taxonomy table. The actual model is paginas + publisher_pages; no tag/category CRUD or editorial approval is implemented here.
See also
Tailwind editor and escaped content
The content editor escapes HTML before placing it in textarea. Examples containing entities or a closing textarea stay editable text. Plain structured fields are escaped; HTML fields preserve their authored content. Existing documents saved before this correction need comparison with their original source: escaping on display does not recover damaged content. Template cards and copy buttons use the shared panel controls.