It appears that %globals_asset_contents:XXX% is not working in our matrix installation (v5.2.7.5).
I'm trying to render the contents of an asset listing within a conditional comment in a paint layout.
The documentation says %globals_asset_contents%, %globals_asset_contents_raw%, %globals_asset_contents_raw_containers% should do the trick but none of these work when you add the ":XXX" to the keyword
In the "Problem with globals_asset_contents" topic from 2012 Kurne Baker (Squiz Staff) recommends using %asset_contents_paint_raw:xxx% but that doesn't work either.
I thought the problem might be to do with having it nested within conditional comments in a paint layout but when I tried each possibility in turn in a standard asset none of them worked.
That should work anywhere really, especially within paint layouts. What are the contents of XXX that you are trying to print? Is it just a standard page? And does it work if you just print it outside your conditional keywords? Just straight into the type format? Or even printing it on a standard page?
After some more testing, the problem only occurs when trying to render an asset listing assets.
When I use %globals_asset_contents:283859% or %globals_asset_contents_raw:283859% (#283859 is a standard page) it works fine. But when I use either of those keywords with with an asset listing e.g. %globals_asset_contents:818009% or %globals_asset_contents_raw:818009% (#818009 an asset listing) it doesn't work.
(I tested both within and outside conditional keywords.)
What does the asset listing actually print? Does it have dynamic root nodes that are not taking affect by using the globals_ format? Or it doesn't even print the No Results format of the asset listing either if you do %globals_asset_contents_raw:818009%? If it's just a basic asset listing that has a fixed root node and lists a few assets, and that doesn't work with globals_asset, send in a bug report for us to check out with replication steps.
Hmm, that does sound strange. You might need to send in a support ticket to have it investigated as well (if you are a squiz client), but if it's non urgent, report it as a bug on https://squizmap.squiz.net/matrix
I was wrong when I said that the static root node asset listing didn't work. When I tested it again, it did work. Only the Dynamic Root node listing didn't work.
It seems that there was an issue with the asset listing itself.
My colleague Gertjan was bored and asked to have a poke at the problem. He recreated the listing (instead of cloning an existing asset as I did). He also used a different replacement root node source: "Set value". Instead of the "Current Asset" Source that I was using, plus I had not included the percent characters with the keyword. His version worked.
Working dynamic root node configuration:
Parameter: Replacement Root node for the listing (must be a child of the static root node)