Configuring a Trigger to Create an Image Variety

Last Updated: 30 Jul 2018

This guide has been superseded by the following tutorial: How to Create Image Varieties Using a Trigger.

This example will configure a Trigger to create an Image Variety when an Image asset is created. This can be useful if, for example, you have a section of your Site requiring images be of a certain size. Instead of manually creating an Image Variety for each Image asset created, this Trigger will automatically create these Varieties. For more information on Image Varieties, refer to the Image chapter in the Core Assets manual.

Please note that if you have Edit+ for Squiz Matrix installed on your system, the trigger settings required will differ due to the way Edit+ handles the creation of files. Please refer to the appropriate sections below, based on your configuration requirements.

Bookmarks to the headings on this page:

  1. Administration Mode
  2. Edit+ for Squiz Matrix

Administration Mode

To configure a trigger to create an image variety in the Administration back-end interface, follow the steps outlined below:

  1. Create a new Trigger asset.
  2. Enter a Name and Description for the Trigger, as shown in the figure below.

    The Details section (Administration Mode)
    The Details section of the Trigger

  3. In the Events section, select the Asset Created event. This will mean that the trigger will be fired when an asset is created.
  4. In the Conditions section, select the Interface Mode condition and click Commit. The configuration fields for this condition are shown in the figure below.

    The Interface Mode condition
    The Interface Mode condition

    In the fields available, select the Backend Interface option.
  5. In the Conditions section, select the Tree Location condition and click Commit. The configuration fields for this condition are shown in the figure below.

    The Tree Location condition
    The Tree Location condition

    In the Asset is Under Any One of These Locations field, select the asset(s) that the trigger should fire under.
  6. In the Conditions section, select the Asset is of Type condition and click Commit. The configuration fields for this condition are shown in the figure below.

    The Asset is of Type condition
    The Asset is of Type condition

    In the Match any one of these Types field, select Image.
  7. In the Actions section, select the Create Image Variety action and click Commit. The configuration fields for this action are shown in the figure below.

    The Create Image Variety action
    The Create Image Variety  action

    Enter a name for the varieties that will be created and specify the variety dimensions. Select the Ignore Permissions field to allow Squiz Matrix to ignore the access rights of the user/s firing this trigger when performing this action.
  8. When you are satisfied with the settings of this Trigger, change its Status to Enabled and click Commit.

When an Image is created in the Administration interface, an Image Variety will now be automatically created, in accordance with the settings of the Create Image Variety action.

Edit+ for Squiz Matrix

To configure a trigger to create an image variety in Edit+ for Squiz Matrix, follow the steps outlined below:

  1. Create a new Trigger asset.
  2. Enter a Name and Description for the Trigger, as shown in the figure below.

    The Details section (Edit  for Squiz Matrix)
    The Details section of the Trigger

  3. In the Events section, select the Simple Edit Accessed event. This will mean that the trigger will be fired when a user views an asset in Edit+ for Squiz Matrix.
  4. In the Conditions section, select the URL Matches condition and click Commit. The configuration fields for this condition are shown in the figure below.

    The URL Matches condition
    The URL Matches condition

    In the URL Pattern field, enter file_create=true, and then enable the Must be in URL option.
  5. In the Conditions section, select the Tree Location condition and click Commit. The configuration fields for this condition are shown in the figure below.

    The Tree Location condition
    The Tree Location condition

    In the Asset is Under Any One of These Locations field, select the asset(s) that the trigger should fire under.
  6. In the Conditions section, select the Asset is of type condition and click Commit. The configuration fields for this condition are shown in the figure below.

    The Asset is of Type condition
    The Asset is of Type condition

    In the Match Any One of These Types field, select Image.
  7. In the Actions section, select the Create Image Variety action and click Commit. The configuration fields for this action are shown in the figure below.

    The Create Image Variety action
    The Create Image Variety action

    Enter a name for the varieties that will be created and specify the variety dimensions. Select the Ignore Permissions field to allow Squiz Matrix to ignore the access rights of the user/s firing this trigger when performing this action.
  8. When you are satisfied with the settings of this Trigger, change its Status to Enabled and click Commit.

When an Image is created in the Edit+ for Squiz Matrix, an Image Variety will now be automatically created, in accordance with the settings of the Create Image Variety action.