Dynamic asset listing - array of assets based on JS array


(Bmasters) #1

Matrix Version: 4.18.0

I’ve got an array, which is stored in a cookie. This array just contains asset ids. eg [‘1234’, ‘1426’, ‘1257’]
I can access and store this array in a javascript variable.

I’d like to use an asset listing to iterate through these assets and display various info.
eg. <h3>%asset_name%</h3><p><a href="%asset_url%">%asset_metadata_dc.description%</a></p>

So I have my Asset Listing looking for an array of asset IDs passed in by the GET var ‘myArray’
I have a Standard Page, with a Nested Content area nesting my Asset Listing
I am passing a GET variable ‘myArray’ to this nested item.

If I manually enter the value of my GET variable, everything is fine. But can I pass my javascript variable?

Any help would be greatly appreciated.


(Bmasters) #2

Just realised that there is a keyword replacement %globals_cookie_% which has solved my issue completely!