Skip to content

media.xml ​

XML schema: media.xsd · Linking and validation.

media.xml adds package-defined attributes to media items.

Use it when a package needs additional metadata on files or folders in the project media area. Keep attribute names package-scoped because media attributes are shared with the project media system.

Basic Structure ​

Create media.xml in the package root.

xml
<?xml version="1.0" encoding="UTF-8"?>
<quiqqer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="https://www.quiqqer.com/docs/schemas/2.x/media.xsd">
    <media>
        <attributes>
            <attribute>vendor.package.media.flag</attribute>
            <attribute default="0">vendor.package.media.sortIndex</attribute>
        </attributes>
    </media>
</quiqqer>

QUIQQER scans installed packages for media.xml and reads attributes from:

text
quiqqer/media/attributes/attribute

Each attribute entry provides:

  • the attribute name as the element text
  • an optional default attribute

Attribute Names ​

Use stable, package-scoped names.

xml
<attribute>vendor.package.media.previewMode</attribute>

Do not use generic names such as type, status, or enabled. They are hard to trace once multiple packages add media metadata.

Defaults ​

Use default when new media items should receive an initial value.

xml
<attribute default="standard">vendor.package.media.displayMode</attribute>

Defaults should be simple scalar values because they are imported as attribute metadata.

Practical Checklist ​

Before adding media.xml:

  • Add it only when package code reads or writes media item attributes.
  • Use package-scoped attribute names.
  • Keep defaults simple.
  • Document the attribute meaning in the package README when administrators or integrators need to understand it.

Released under GPL-3.0-or-later.