Information Classification: External Restricted.
See https://www.chili-publish.com/security

Alternate Layouts XML

XML Structure

Alternate Layouts are a top-level resource within a document, containing a list of ?Document Object Model - AlternateLayout items:

<document>
  <alternateLayouts>
    <item id="123-456-789" name="[Default]"  />
    <item id="5845-59684-5" name="Landscape" />
  </alternateLayouts>
</document>

NOTE: the [Default] layout always exists, and cannot be renamed, as that name is used internally to retrieve default property values for layout-specific properties (see lower)

AlternateLayout items

In itself, the alternate layout items are very straightforward. The complexity of the layouts lies in the storage of layout-specific properties of other objects (see lower)

Referencing Layouts

Alternate Layouts are referenced by some properties directly (eg the "initialLayout" property of a document, which contains the last selected Alternate Layout during editing). It is also used in the ?Document Object Model - AlternateLayoutSelection object, which is used on various levels (page, layer, frame) to specify that that item is only included in some (selected) layouts. But most importantly, it is used in the ?Document Object Model - AlternateLayoutProperty object.

Alternate Layout specific properties

All complex CHILI Objects eventually inherit from the ?Document Object Model - DocumentBase description, and as such they can all have certain data inside the XML. This includes an "alternateLayoutProperties" property, of type ?Document Object Model - AlternateLayoutProperties (containing items of type ?Document Object Model - AlternateLayoutProperty). Here, the values for the various alternate layouts are stored for that object.

Properties on which this applies include:

  • document
    • width
    • height
  • frame
    • x
    • y
    • width
    • height
    • rotation

Each AlternateLayoutProperty item within that list contains a reference to the property name (eg "width" for document width), a reference to the layout on which it applies, and a "value". This only applies to layouts besides the "Default" (system) layout. For that, the property values are stored/maintained following the normal XML rules. So for the above sample document, the following XML would set the width/height of the document to the actual landscape values:

<document width="210mm" height="297mm">
  <alternateLayouts>
    <item id="123-456-789" name="[Default]"  />
    <item id="5845-59684-5" name="Landscape" />
  </alternateLayouts>
  <alternateLayoutProperties>
    <item name="width" layout="5845-59684-5" value="297mm" />
    <item name="height" layout="5845-59684-5" value="210mm" />
  </alternateLayoutProperties>
</document>

And deeper within the document's XML structure, you might find a frame in a page, containing new dimensions for that same Landscape layout:

<frames>
  <item type="rectangle" x="10mm" y="10mm" width="100mm" height="50mm">
     <alternateLayoutProperties>
       <item name="x" layout="5845-59684-5" value="50mm" />
       <item name="y" layout="5845-59684-5" value="20mm" />
       <item name="width" layout="5845-59684-5" value="20mm" />
       <item name="height" layout="5845-59684-5" value="60mm" />
     </alternateLayoutProperties>
  </item>
</frames>

Default Content

The basic/system Default layout will always be added by CHILI editor if it doesn't exist inside the XML.

If the value of an alternate layout specific property is not present, the "default" value (using normal XML rules) is used.

All information on this page must be treated as External Restricted, or more strict. https://www.chili-publish.com/security