Keyword for site details for current listed asset?


(Douglas (@finnatic at @waikato)) #1

Matrix Version: 5.4.1.2

I’ve created an asset listing for each of our Matrix instances to list custom form and asset builder assets, looking to have a better picture of submissions that might be affected by upgrades or major system changes.

One of the details I’d like to include is the asset lineage, and in particular which site the asset lives under.

%asset_lineage% will give me the first part of that, but I’m not having luck finding something to give me the site detail quickly.


(Bart Banda) #2

Would %asset_linking_info_current% give you want you need?

A JSON object of the linking information of the current asset’s link only, based on its current lineage context.


(Douglas (@finnatic at @waikato)) #3

I think it might do. Just need to push it through some SSJS - is there a way I can access the lineage subarray directly from the keyword in this:

> <script runat="server">
> var linkingInfo = %asset_linking_info_current%;
> var lineage = linkingInfo.lineage;
> // want first two items typically for the parent folder and parent site in our setups
> print('%globals_asset_name:'+linkingInfo.lineage[0]+'% :');
> print('%globals_asset_name:'+linkingInfo.lineage[1]+'% : ');
> </script>

?


(Bart Banda) #4

You could also try and use %asset_linking_lineage% perhaps?

That way you could easily just do:

%asset_linking_lineage^index:0^as_asset:asset_name%
%asset_linking_lineage^index:1^as_asset:asset_name%

(Douglas (@finnatic at @waikato)) #5

That’s a lot simpler. I’m happy using SSJS now, but I’m mindful that some of our content staff may not be. Plus, having to lookup unknown keyword modifiers always gives you the opportunity to discover more :slight_smile:


(Douglas (@finnatic at @waikato)) #6

This needs to be:

%asset_linking_lineage^json_decode^index:0^as_asset:asset_name%

and behaviour isn’t consistent for assets which aren’t inside a site asset.


(Bart Banda) #7

Yep, that’s a bug, https://squizmap.squiz.net/matrix/11689, which is fixed in 5.5.


(Douglas (@finnatic at @waikato)) #8

Is there an expected release time frame for 5.5 ? Are there many changes?


(Bart Banda) #9

We are aiming for end of April at this stage.

Lots… :slight_smile:


%asset_parent% output != %asset_parents% for Site assets