Marker shortcuts
- 1 minute to read
Markers in the Design Editor are a good tool to tune the design element behavior, but in a number of cases, you have to repeat the same work many times and insert several markers, which can make the layer names cluttered and difficult to read. When you design complicated templates, you may want to define shortcuts for combining several markers and applying them to multiple design elements.
Let us say that you design a template containing a dozen design elements that you need to lock, but also allow them to be deleted. In this case, you can add the following marker group to each layer name.
<MAD_t><MAMH_f><MAMV_f><MAR_f><MRE_f><MRC>
Such layer names get cluttered on the Layers tab.
To make this list more readable, you can use shortcuts. The Design Editor supports shortcuts for markers and permissions. You can find the predefined list of shortcuts in the ~\Configuration\TemplateConfigShortcuts.json file. Also, you can add custom shortcuts to this file.
The following example shows how you can define both the permission and marker shortcuts for locking deletable elements.
{
"item_locked_deletable|ITEM_LD": {
"manipulationPermissions": {
"allowDelete": true,
"allowMoveHorizontal": false,
"allowMoveVertical": false,
"allowRotate": false,
"resizeGrips": {
"edge": false,
"corner": []
}
}
}
}
Here, item_locked_deletable
is the permission shortcut name; you can use this name in your <template>.json files, where you define permissions for templates. ITEM_LD
is the marker shortcut name; you can apply this name in your templates. Using this definition, you can replace the previous marker chain with the <ITEM_LD>
shortcut in your PSD and IDML templates.
Marker shortcuts do not take any values. They are boolean and true
by default. If you set a permission shortcut to false
, then corresponding permissions are removed from the design element.
If you combine shortcuts, permissions, and markers in your templates, consider the following priority levels:
- Single permissions in <template>.json have the highest priority.
- Permission shortcuts defined in TemplateConfigShortcuts.json.
- Single markers in a PSD/IDML file.
- Marker shortcuts in a PSD/IDML file.
For example, if you add both the <ITEM_LD>
marker shortcut and the <MAD_f>
marker to a layer name, then this combination disallows deleting the corresponding element as the single marker <MAD_f>
defines.