Keyword chain sequence


(Ben Chapman) #1

Matrix Version: 5.5.3.1

You know how it goes: you nest some asset’s content by a %globals_asset_contents:XX% keyword on a page that is nested in a content container template which is applied to a page that is set as metadata which is included in the site’s design file through %asset_metadata_mdname^as_asset:asset_contents_raw%, and in the end you don’t that original asset’s content but instead see “%globals_asset_contents:XX%” sitting there on the page.

So my question: if I am calling the content of an asset using something like %asset_metadata_mdname^as_asset:asset_contents_raw%, why is my %globals_asset_contents:XX% not being replaced?

My guess is that it has something to do with the order in which the keyword replacements are applied.

My next question is, is there an alternative way I could attempt this?

Thanks so much.


(Ben Chapman) #2

So, some experimentation shows that it is more likely due to the fact that the design file is involved.

Still confused though.


(John gill) #3

Order of execution is often a factor, but I’ve never come across a situation where %globals_asset_contents:12345% ended up not being processed - at the very least it should be replaced with blank.

Design file sounds pretty likely. I’ve previously run into the situation where %begin_ conditional keywords don’t work in designs, so the rules are definitely different.


(Ben Chapman) #4

Interestingly I have a %begin_ right where my %globals_asset_contents is failing. (So I wonder if that is the problem…) The %begin_ checks that the raw content of the asset is not empty, then is supposed to include the asset’s contents with its paint layout.

Here’s my specific code:

%begin_globals_asset_contents_raw:1808460%
%globals_asset_contents:1808460%
%end_globals%

The %begin works but the %globals doesn’t, so I only see the un-replaced %globals keyword when there is content, otherwise it is blank.


(Ben Chapman) #5

I’ve fixed my own problem by switching to a method using metadata, so I draw the content of the asset through %asset_metadata_… Which is a nice in that it means I don’t have to specifically reference the asset by it’s id, but the metadata is one more thing I have to keep track of.

Still intrigued by the initial keyword replacement failure, so if anyone has any insight, I would be interested to hear it.


(Bart Banda) #6

If you are seeing %globals_asset_contents:XX% on the frontend, it normally means you’ve exceeded the 2 levels of Global Keyword nesting that is allowed. This should show up in the Error log as well so check in there if you see it again if you don’t see that error on the frontend.