Global keyword %globals_asset_contents% appears empty for Asset Listings


(*) #1

I’m attempting to include the rendered body (eg what gets rendered via a body Design Area / comes from $asset->printBodyWithPaintLayout()) of an Asset Listing inside another page and trying to use the keyword:

%globals_asset_contents:123456%

to include it. Accessing the Asset Listing directly via its URL shows the rendered listing, but the above keyword is always empty. Is this the right keyword to be using, or is there another? For note, I’ve found that I can work around the issue by using this:

%globals_asset_assetid:123456^as_asset:asset_contents%

which outputs the rendered body correctly. Looking at the two keywords, I envisaged the two being synonymous but when placed one-after-the-other in a Standard Page, the output is different.

Is this a bug or should I be using another keyword to get what I’m after? I’m using Matrix 5.3.3.0.


(Bart Banda) #2

Hmm, %globals_asset_contents:123456% works fine for me in 5.3.

Can you try %globals_asset_contents_raw:123456% to see if that gets you anything?

Also, what is the contents of the PL? Do you get the expected one if you do %globals_asset_paint_layout_id:123456% ?


(*) #3

I set up a test design that dumps all keywords and all of:

%globals_asset_contents%
%globals_asset_contents_raw%
%globals_asset_contents_raw_containers%

are all empty. Looking at the raw HTML there’s not even whitespace echoed for any of these.

The contents of the paint layout are stock standard: %asset_contents% for the Default Format and %paint_layout%. And yes, %globals_asset_paint_layout_id:123456% shows me the correct paint layout ID.

Curiously, the standard Body Design area (<MySource_AREA id_name="body" design_area="body" />) works fine (tested directly + in the main Design) which implies the Paint Layout is fine.

Any more thoughts?


(Bart Banda) #4

Are you printing these directly into the parse file? I’m trying all of those and they work fine, both in parse file directly and in a standard page.

There are no errors in the logs are there?

Did %globals_asset_contents_raw:123456% or %globals_asset_contents_raw% give you anything?


(*) #5

Yes, they’re going directly into the parse file but I’m also placing the same keywords into a Standard Page content container with the same effect. I’ve got both variants of %globals_asset_contents_raw:123456% and %globals_asset_contents_raw% in both Parse and content containers and they both come up empty. Only the ^as_asset:asset_contents% modifier has worked so far.

Happy to look at logs (assuming I have or can get access) – you’ll have to point me at where I need to look. If there are areas where errors get logged, that’d be helpful; I’m just black-box testing these issues.


(Nick Papadatos) #6

Interestingly I use %asset_contents_raw_containers% and that works fine for me (version 5.3.4.2)


(*) #7

@NickyP, just to confirm, is that to display the rendering of an Asset Listing’s results? If so, in what type of Asset do you have that keyword included? My testing has the same result in referencing the Asset Listing from either a Design, or Standard Page.

Perhaps it’s a bug in 5.3.3.0 that was fixed later.


(Bart Banda) #8

This sounds strange David, might be best to send a support ticket to Squiz for a Bris Implementer to have a look more closely to see if it’s expected, implementation issue, or a bug.


(Nick Papadatos) #9

Yes to your question David - to display the asset contents of an ALP.


(*) #10

Okay, in testing another Asset listing, its keywords are working fine. The problem must therefore be specific to this asset listing in some manner; perhaps the keywords aren’t populating correctly or there’s a bug in the implementation.

I’ve retained a copy of the asset in case this comes up again and makes it worthwhile reporting as a support ticket. For now, I’ll just carry on.

Thanks for the input.