Confounding conditional keyword failure


(Andrew Harris) #1

Matrix Version: v5.4.1.3

I’m having a problem with a paint layout used to display an asset in a page via a get variable:
%globals_get_banner^as_asset:asset_contents_paint_2685387%

I’m greatly simplifying this, but basically, the problem is as follows:

The assets are images, and have a Metadata Select Field named Style with some simple text values.
On a particular asset, I have Metadata selected as ‘focus’.

This keyword evaluates as ‘focus’
%globals_get_banner^as_asset:asset_metadata_Style%

This keyword evaluates as Yes:
%globals_get_banner^as_asset:asset_metadata_Style^eq:focus:Yes:No%

But this construct returns ‘Unspecified’
`%begin_globals_get_banner^as_asset:asset_metadata_Style^eq:focus%

Focus

%else_globals%

Unspecified

%end_globals%`

Leaving me utterly flummoxed!
Any ideas, people?


(Andrew Harris) #2

And once again, I’ll just answer my own question for the record/benefit of others…

In the first line of my code above, I’m using a get variable as_asset to paint.

Therefore, I’ve already specified the asset to paint, I don’t need to keep using globals_get_banner^as_asset in the paint layout, that’s redundant and seemed to be just getting in the way.

So, my last construct should have looked something like:
`%begin_asset_metadata_Style^eq:focus%

Focus

%else_globals%

Unspecified

%end_globals%`

Big thanks to Garvin at Squiz for patiently, and promptly pointing out my mistake!