Defining a MixinΒΆ

Structures of data that are likely to be repeated in different content types can be defined in a single mixin. For example, a standard address form might be used in several content types. Each mixin definition file must be named mixin.xml and it must be placed in its own folder inside the mixins folder.

Go ahead and create the file below in a folder named us-address. The name of this folder will be used later when it is time to implement the mixin in another content type configuration.

<mixin>
  <display-name>U.S. Address format</display-name>
  <items>
    <form-item-set name="address">
      <label>Address</label>
      <immutable>false</immutable>
      <occurrences minimum="0" maximum="0"/>
      <items>
        <input type="TextLine" name="addressLabel">
          <label>Address Label</label>
          <immutable>false</immutable>
          <indexed>true</indexed>
          <occurrences minimum="0" maximum="1"/>
        </input>
        <input type="TextLine" name="addressLine">
          <label>Address Line</label>
          <immutable>false</immutable>
          <indexed>true</indexed>
          <occurrences minimum="1" maximum="2"/>
        </input>
        <input type="TextLine" name="city">
          <label>City</label>
          <immutable>false</immutable>
          <indexed>true</indexed>
          <occurrences minimum="1" maximum="1"/>
        </input>
        <input type="TextLine" name="state">
          <label>State</label>
          <immutable>false</immutable>
          <indexed>true</indexed>
          <occurrences minimum="0" maximum="1"/>
        </input>
        <input type="TextLine" name="zipCode">
          <label>Zip code</label>
          <immutable>false</immutable>
          <indexed>true</indexed>
          <occurrences minimum="1" maximum="1"/>
        </input>
      </items>
    </form-item-set>
  </items>
</mixin>