Static content around keyword replacement and modifiers being repeated


(Oscar) #1

Matrix Version: 5.5.6.4

I’m trying to display the contents of another asset on a page using the following keyword replacement and modifiers:-

%globals_asset_contents_paint_layout_id_605582:AID^replace:AID:{globals_get_event}%

I pass the asset ID of the asset content that I want to display as a URL pararmeter (ie. ?event=605064).

This works but the strange thing is that static content before and after the above statement is being displayed twice.

Please see http://cec.health.nsw.gov.au/configuration/events/events/2020/sep/test?event=605064

image

Anyone got any idea why this is happening?

As a side note, I thought that the following would work but it doesn’t. Any ideas why?

%globals_asset_contents_paint_layout_id_605582:{globals_get_event}%

Thanks


(John gill) #2

%globals_asset_contents_paint_layout_id_605582:AID^replace:AID:{globals_get_event}% isn’t a valid keyword, but somehow it’s glitching in a way that actually evaluates the content you want, but also renders that container twice.

My guess is that it’s being evaluated in two passes - that broken keyword causes the double render and evaluates to a string which then gets picked up as another globals keyword and reprocessed, and it’s the second one that spits out what you want - but working out exactly what is going on probably won’t help.

I think the keyword you want is

%globals_get_id^as_asset:asset_contents_paint_layout_id_605582%