Configuring a Trigger to Prevent Image Assets From Being Created
17 Dec 2015
This example will configure a Trigger to prevent users from creating Image assets under our Site asset, displaying an error message to them instead.
To configure this Trigger, follow the steps outlined below.
- Create a new Trigger asset.
- Enter a Name and Description for the Trigger, as shown in the figure below.
- In the Events section, select the Before Asset Created Trigger Event.
- In the Conditions section, select the Tree Location Trigger Condition and click Commit. Additional fields will appear in the Conditions section, as shown in the figure below. In the Asset is Under field, select the Site asset.
- In the Conditions section, select the Asset is of type Trigger Condition and click Commit. Additional fields will appear in the Conditions section, as shown in the figure below. In the Match any one of these Types field, select Image.
- In the Actions section, select the Fail Trigger Action and click Commit. Additional fields will appear in the Actions section, as shown in the figure below. In the Trigger an error of type field, select Error and enter an error message that will appear, for example Images should be created under the Media Folder in the Asset Map.
- When you are satisfied with the settings of this Trigger, change its Status to Enabled and click Commit.
When a user tries to create an Image asset under the Site asset, an error message will now appear and the system will not create the image.
- Server Side JS
- Squiz Edge
Write a Tutorial
Help us build a healthy library of useful tutorials for the Matrix Community.