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

Changing classes and content

Where a site package's content classes and demo content live, how their XML files are listed as install items, the two ways to change them (edit the files, or build on a test site and export), why remote IDs must stay…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/site-packages/your-own/changing-classes-and-content.md

On this page

Changing classes and content

This page is for developers and site builders who want their own site package to install other content classes or other demo content than the package they forked. It shows where these live, how to change them, and what to keep stable so the installer script still finds what it expects.

7x and the Exponential Foundation strongly encourage you to share the finished package by pull request to se7enxweb/exponential.packages.exponential.earth: see Contribute your site package.

Contents

  1. Where classes and content live
  2. How the files are listed
  3. Way 1: edit the files
  4. Way 2: build on a test site and export
  5. Keep remote IDs stable
  6. What is not in the packages
  7. Before you rebuild

Where classes and content live

A site package itself carries no classes and no content. It requires packages that do:

Package (7x)TypeHolds
sevenx_classescontentclassezcontentclass/class-<identifier>.xml, one file per class (33 files in the source repository)
sevenx_multisite_democontentcontentobjectits own classes in ezcontentclass/, the objects in ezcontentobject/ (contentobjects.xml plus one object-*.xml per object), binary files in simplefiles/
sevenx_multisite_democontent_cleancontentobjectthe content of the variants without demo articles

A fork usually keeps the classes package and replaces the content package, as cjw_multisite does with cjw_multisite_democontent. See The demo content packages and sevenx_classes.

How the files are listed

Nothing in a package is installed because it is in the folder; only the install items of package.xml are:

<install>
  <item type="ezcontentclass" filename="class-article" sub-directory="ezcontentclass"/>
  <item type="ezcontentclass" filename="class-folder" sub-directory="ezcontentclass"/>
  <item type="ezcontentobject" filename="contentobjects" sub-directory="ezcontentobject"/>
</install>

type selects the handler (package.ini [PackageSettings] HandlerAlias[], for example ezcontentclass = eZContentClassPackageHandler), filename is the file without .xml, sub-directory the folder. A class file you add needs its own <item>; a class file you remove needs its <item> removed. See Install items and handlers.

Way 1: edit the files

Good for small changes: a class name, an attribute's description, a text in one object.

cd packages/acme_classes/ezcontentclass
xmllint --noout class-article.xml     # well formed after your edit

A class file holds the identifier, the serialized names per language, the remote ID, the attributes with their datatype and settings, and a <remote> block describing where it was exported from. Keep the structure the kernel wrote; change values, not element names.

Way 2: build on a test site and export

Good for new classes, new attributes and new content: model it in the administration of a test installation (one installed from your current package), then export it and copy the files into your source repository.

# classes by identifier, comma separated
php ezpm.php create acme_classes_export 'Classes export' 1.0.0 install
php ezpm.php add acme_classes_export ezcontentclass article,folder
php ezpm.php export acme_classes_export -d var/tmp

# a content subtree, without its classes
php ezpm.php create acme_content_export 'Content export' 1.0.0 install
php ezpm.php add acme_content_export ezcontentobject /content/demo --exclude-classes
php ezpm.php export acme_content_export -d var/tmp

The same exports are on Setup > Packages > Create new package (Content class export, Content object export): Creating packages with the wizard. Then unpack the archive and copy the class or object files, and the <item> lines of its package.xml, into your package folder:

mkdir -p var/tmp/unpacked && tar -xzf var/tmp/acme_classes_export-*.ezpkg -C var/tmp/unpacked

ezpm export names the archive <name>-<version>-<release>.ezpkg (eZPackage::exportName()); see Creating packages with ezpm for the options.

Tip

Before you install a changed content package anywhere, php ezpm.php check <package> lists what the install would meet on that installation, by remote ID, and writes nothing.

Keep remote IDs stable

Packages find things by remote ID. The class handler looks for an existing class with eZContentClass::fetchByRemoteID() and asks what to do when it exists; the content install sorts objects into new, existing and conflicting by remote ID (Look inside a package, compare it with your site). The 7x installer relies on fixed remote IDs as well: mainSiteaccessHomeRemoteID() returns "the remote id of the main site's home node, as shipped by the demo content package".

So:

  • Do not change the remote ID of an object or class the installer script refers to; search the installer for the ID before you touch it.
  • Give new objects and classes new remote IDs (exporting from a test site does this for you).
  • A fork that installs next to the 7x content should not reuse 7x remote IDs for different things.

What is not in the packages

DataWhere it comes from
Layouts, zones, blocks and layout rules (explayouts_* tables)extension/sevenx_themes_media/share/db_data.dba and extension/explayouts/share/, loaded by the installer (Layouts data and share .dba files)
Tags and star ratings of the demo contentsevenx_themes_media's share/db_data.dba, by the same step
Settings, siteaccesses, rolesthe installer script (Changing the installer script)

A demo page that shows its blocks on the 7x site needs its layout in that extension data as well; changing only the content package leaves the page without them.

Before you rebuild

  • To do: Every new class or object file has its <item>, every removed one lost it.
  • To do: xmllint --noout passes for every changed XML file.
  • To do: No editor backups or other leftovers in the folders: build.sh packs every file except the names it excludes (Rebuilding with build.sh).
  • To do: Remote IDs the installer uses are unchanged.
  • To do: The package's version and changelog are raised (Versioning your own packages).

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