Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,113 of 9,113 pages
About the help in other languages
All help pages

Layouts data and the share .dba files

How the explayouts_* layout rows, tags and the demo rating reach a sevenx_multisite database - not from the packages but from the share/*.dba files of sevenx_themes_media and explayouts - and how the post-install maps…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/site-packages/sevenx-multisite/layouts-data-and-share-dba.md

On this page

Layouts data and the share .dba files

This page is for developers who change the layouts of the default sites, and for administrators and hosts who wonder where a fresh installation's layouts come from. It answers: which files carry the explayouts_* rows, how the installer loads them, and how it fits them to the content of the new installation.

Contents

  1. Not in the packages
  2. The files
  3. What the theme seed contains
  4. How the installer loads them
  5. Fitting the rows to the new installation
  6. The default admin layouts
  7. Changing the seed

Not in the packages

None of the five sevenx_multisite packages carries a layout. A content package installs classes and objects; the layouts, zones, blocks, collections and rules of the explayouts extensions live in tables of their own. The installer creates and fills those tables in preInstall(), before the content packages are installed, from .dba files that the extensions ship in their share/ folders.

Note

The file extension/expsite_data_media/data/data.sql is deprecated and unused. The source of the layouts of a new installation is the share/*.dba files described here.

The files

FileContents
extension/sevenx_themes_media/share/db_schema.dbathe tables explayouts_block, explayouts_block_parameter, explayouts_collection, explayouts_collection_item, explayouts_collection_query, explayouts_layout, explayouts_rule, explayouts_rule_condition, explayouts_rule_target, explayouts_zone, eztags, eztags_attribute_link, eztags_keyword, ezurl, ezurl_object_link, ezstarrating, ezstarrating_data, ezpdf_export
extension/sevenx_themes_media/share/db_data.dbathe rows of those tables (all but ezpdf_export)
extension/explayouts/share/db_schema.dbathe same ten explayouts_* tables plus explayouts_share, the three eztags* tables, ezurl, ezurl_object_link and exp_info_collection
extension/explayouts/share/db_data.dbarows for its tables
extension/explayouts/share/fragments/admin_layouts_db_data.dbathe default admin layouts, see below
extension/explayouts/sql/<engine>/schema.sql for mysql, pgsql, postgresql, sqlite and oracle, schema.json for mongodb, and data.sql for oracle

A .dba file is a PHP file with a var_export()ed array ($schema or $data) that eZDbSchema::read() loads; each table has a fields list and numbered rows.

What the theme seed contains

Counted in extension/sevenx_themes_media/share/db_data.dba as it is in 6.0.15:

TableRows
explayouts_layout21, all with status 2 (published)
explayouts_zone101, of which 38 are linked to a shared layout (36 to layout 2, 2 to layout 7)
explayouts_block342
explayouts_block_parameter3648
explayouts_collection, _item, _query70, 59, 48
explayouts_rule, _condition, _target20, 7, 22
eztags, eztags_keyword, eztags_attribute_link31, 31, 264
ezurl, ezurl_object_link321, 495
ezstarrating, ezstarrating_data1, 0

The two shared layouts (shared = 1) are "Header / Footer" (id 2) and "Prefooter" (id 7). The other layouts include "Default Layout", the "Full / ..." layouts for articles, recipes, topics and videos, the landing pages of Fit & Healthy, "Showcase", and the "Bold Agency - ..." layouts. How shared layouts and linked zones work in the editor is on The layouts editor.

How the installer loads them

preInstall() runs dropExtensionTables() and then insertDBFile( package, extension, loadData ) for each entry of extensionSchemas() (see Extensions it activates). For the layouts the order is what matters:

  1. sevenx_themes_media, schema and data. It comes first: "its schema and data carry the layouts, tags and ratings of the demo content". Its tables are created and its rows inserted.
  2. ezstarrating, ezgmaplocation, eztags, schema only.
  3. explayouts, schema and data. insertDBFile() leaves out every table that already exists, "with their data, instead of failing 'already exists'". So the ten explayouts_* tables, the tags and the URL tables keep the theme's rows, and only the tables the theme does not declare (explayouts_share, exp_info_collection) are created here.

Details of insertDBFile():

  • The extension's files are looked for in <package path>/ezextension/<extension> when a package of that name is in the package repository, else in extension/<extension> (extensionBasePath()).
  • Before inserting, dropExtensionTables() drops every table any of these schemas declares. Because the theme's schema declares ezurl and ezurl_object_link, those two tables are recreated with the theme's rows as well.
  • When eZDbSchema has no handler for the database, the engine's files in sql/<engine>/ are used: mysql.sql or schema.sql, postgresql.sql or schema.sql, sqlite.sql or schema.sql, schema.sql on Oracle, schema.json on MongoDB (directory mongodb), then data.sql or democontent.sql from sql/<engine>/ or sql/common/.
  • createMissingSchemaTables() then creates any declared table that the schema insert left out and reports the ones it cannot create.

Fitting the rows to the new installation

The seed was written against the node and object ids of the reference content. After the content is installed, post-install step 35 (sevenxFixPackageNodesAndExplayouts() in post-install-fix.php) maps each package id to the id the new installation gave that node or object, and classifies every reference as mapped (rewritten), base (base data such as node 1, kept) or missing (content the package does not ship, removed):

Table / columnMappedMissing
explayouts_rule_target.target_value (types content_node, ibexa_subtree, subtree, node)rewrittenrow deleted; a rule left without targets is disabled
explayouts_collection_item.value_id (ez_location, ez_content)rewrittenrow deleted
explayouts_collection_query.parameters (parent_location_id, topic_content_id)rewrittenset to 0
explayouts_block_parameter contentrewrittenemptied
eztags_attribute_link.object_idrewrittenrow deleted

With the full demo content nothing is missing; with sevenx_multisite_democontent_clean these removals are what keep the layouts from pointing at unrelated objects. Later steps finish the job: step 40 switches off title-block links (explayouts_block_parameter link, use_link) to paths that do not resolve, and the resolver cache is cleared (expLayoutsResolver::clearCache()). The ezstarrating row of the "Test Product" is re-keyed in step 5, with its average restored to 4.3 because "a .dba cannot carry a fractional one".

The default admin layouts

Step 36, postInstallImportAdminLayouts(), loads extension/explayouts/share/fragments/admin_layouts_db_data.dba: three layouts with ids from 100001, "Admin: left, main, right" (admin_3col), "Admin: left, main" (admin_2col) and "Admin: main only" (admin_full), with their zones, blocks and six rules. It does nothing when an admin layout already exists or the fragment is missing. The admin4l design builds the administration pages from these layouts; see admin4l.

Note

The fragment's own header comment still says "Prepared fragment: NOT read by the installer". That comment predates step 36; the installer does read it.

Changing the seed

  • Edit the layouts on a working installation, then export the tables back into the theme's share/db_data.dba. The seed of 6.0.15 holds published layouts only (every explayouts_layout row has status 2); a draft is one editor's work in progress and does not belong in it.
  • Never review a .dba change by its text diff: removing one row renumbers every row after it. Compare the files row by row instead.
  • Test the result with a full install into a throwaway database; see Testing in a sandbox.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x