Matrix 126.96.36.199 and 188.8.131.52 released21 Apr
The latest 2 releases for the 5.2 and 5.3 branch were released today with the 184.108.40.206 version packing some serious new Matrix goodness. Checkout the release notes for both releases and read on below to discover the new enhancements that have been added.
The following is a list of some notable new features and enhancements released in 220.127.116.11.
New keyword modifier format to pass parameters to keywords
A new type of "pre evaluation" keyword modifier format has been added that enables you to pass dynamic values to a keyword as GET or POST parameters which will get evaluated before the contents of the keyword will. This format is mainly aimed at the %asset_contents% keyword type and will let you pass parameters in a similar way that nested content containers allow you to.
The 3 new keyword modifiers include:
- ^with_context (alias for the existing ^context modifier)
For example, if you are referencing the asset contents of an asset listing that accepts dynamic root nodes as GET parameters, you can use the new ^with_get modifier to send a value like this:
This keyword will pass "9999" as a GET parameter to asset 1234 before being rendered.
You can also pass multiple parameters and use the ^replace_keywords modifier to make the values dynamic:
This keyword will use the value of the current asset's "root" metadata value as the "root" GET parameter, as well as 2 additional parameters to asset 1234 before being rendered.
New "Asset Map" sort order for listing assets
Previously in listing based assets when you wanted to list asset in the order they appear in the asset map, you needed to turn on the "Direct Links" only setting. However turning this setting on restricted you somewhat in the other listing functionality such as link type filtering and multi level listing.
A new dedicated sort order type has now been added to all listing assets that allows you to natively sort by the order of the Asset Map, effective sorting on the asset's "Sort Order" attribute. The new setting can be found on the "Asset Sorting" screen of listing assets and needs to be enabled within the "Extra Sort-by options" section before showing up as a new sort order option.
If listing assets over multiple levels, the listing will first list all assets of the first level including it's children before proceeding to the next asset at the first level. For example, if we have the following asset structure in place:
| - Asset 1 | - Sub Asset 1.1 | - Asset 2 | - Sub Asset 2.1 | - Sub Asset 2.2
Using the "Asset Map" sort option with "Ascending" sort direction, the assets would be listed in the following order:
Asset 1 Sub Asset 1.1 Sub Asset 2 Sub Asset 2.1 Sub Asset 2.2
Keyword for event duration in iCal format
Squizmap | Idea by Andrew Harris (Squiz Client)
A new keyword called %event_duration_ical% has been added that enables you to print the duration of a calendar event asset in iCalendar format. For example:
%event_duration% => 101 days, 3 hours and 23 minutes %event_duration_ical% => P3M10DT3H23M
New else_begin keyword format for conditional keywords
Conditional keywords are powerful for printing content if a certain condition is met. You can also easily print alternative content if the condition is false.
A new keyword format has now been added to these conditional keywords that lets you chain conditions after each other and only print the first version of the content when the first of multiple conditions is met.
Using the %else_begin_<keyword>%, you can conditionally print alternative content if the previous condition was false, for example:
%begin_asset_thumbnail% <!--@@ Print the asset's thumbnail if it has one @@--> %asset_thumbnail% %else_begin_asset_metadata_related-image% <!--@@ Otherwise, print the image asset set in the related metadata field if it has one @@--> %asset_metadata_related-image^as_asset:asset_contents% %else_begin_asset_parent^as_asset:asset_thumbnail% <!--@@ Otherwise, print the thumbnail of the parent asset if it has one @@--> %asset_parent^as_asset:asset_thumbnail% %else_asset% <!--@@ Otherwise, print a note @@--> <em>No Thumbnail</em> %end_asset%
Trigger action for setting SugarCRM Record ID
A new trigger action has been added to enhance the integration capability between Squiz Matrix and SugarCRM.
The new "Set SugarCRM Record ID" trigger action lets you specify the Module and Record ID value to set, as well as using dynamic parameters for both of these values.
The trigger action is only supported for firing on user based asset types.
Ability to escape reserved characters in keyword modifiers
Reserved special characters within keyword modifiers can now be escaped using a backslash. This is useful if you want to replace content with characters that contain these reserved characters, namely colons and carets:
For example, the following keyword will replace the "http://" value in the keyword with "https://":
Because the backslash now works as an escape character for colons and carets, a script called upgrade_escape_keyword_modifier_char.php has been added that can help you identify any areas in your Matrix instance that have these characters in place already as they will need to be reviewed and potentially replaced with double backslashes, for example instead of this:
You will need to do this:
Optional keyword replacements in REST JS files
Squizmap | Idea by James Hurst
The new configuration option allows you to control which JS files you want to replace keywords within before being used in the processing. Disabling keyword replacement on large JS files can help speed up the performance when processing the JS code and rendering of the content.
For a complete list of new features and enhancements, check out the release notes.