globals_asset_contents:XXX not working


(Evan Wills) #1

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 also tried Dan Simmons suggestion of using %globals_snippet_XXX% from the topic "Using conditions to nest in different content" (2011) but that didn'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.

 

Is this a bug or am I missing something?


(Bart Banda) #2

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?


(Evan Wills) #3

Hi Bart

 

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.)


(Evan Wills) #4

Should I file a bug for this?


(Bart Banda) #5

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. 


(Evan Wills) #6

Hi Bart

 

Nothing is printed. At first I thought it was because the listing wasn't finding anything but the "No results" content isn't being printed either.

 

The listing is using dynamic root nodes

 

Replacement Root node for the listing... Current Asset

keyword - globals_asset_metadata__right-col_web-tile_1_display-type


(Bart Banda) #7

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 


(Evan Wills) #8

Thanks Bart

 

I'll do both.


(Evan Wills) #9

Hi again, I tested using another asset listing with a static root node and have the same problem.

 

Interestingly, when I nested the dynamic root node asset listing within a standard page I broke the page from that point on. i.e. no more HTML printed from the point that asset was nested. (see Alt Entry (testing nested - dynamic root - asset listing)). All was fine when nesting the static root node version of the asset listing. (see: Alt Entry (testing nested - static root - asset listing) )

 

PS: I've filed a bug report here: Possible bug: globals_asset_contents_raw:XXX not working #8746


(Evan Wills) #10

Correction to my last post.

 

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.


(Evan Wills) #11

Further update:

 

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)

Source:  "Set Value" "%globals_asset_metadata__blah-blah-blah%"

 

Failing dynamic root node configuration:

Parameter: Replacement Root node for the listing (must be a child of the static root node)

Source:  "Current Asset" "globals_asset_metadata__blah-blah-blah"