Replace_keywords to get dynamic asset content


(Gabriele Antonini) #1

Hi, I'm trying to retrieve the content of an asset A from another asset B.
The id of the asset A must be dynamic depending on a get parameter passed to the asset B (which is nested).

Now, I tried with something like this:
 

%globals_asset_contents^replace_keywords:{nested_get_gamesFeedId}%

But it's not working, it just doesn't print anything.

%globals_asset_contents:12345%

Works fine (but it's not dynamic)

%nested_get_gamesFeedId%

It prints the correct item id 12345

 

 

So, apparently the get variable is correctly resolved, if I try to access statically to the asset content it works, if I use the replace_keywords to make it dynamic, it fails.

 

Any ideas?

 

Thanks,

Gab

 


(Peter McLeod) #2

Hi

Maybe try the 'as_asset' keyword modifier instead:

https://manuals.matrix.squizsuite.net/keyword-replacements/chapters/keyword-modifiers

Thanks

Peter


(Bart Banda) #3

Yea what Peter said, so try this:

%nested_get_gamesFeedId^as_asset:asset_contents_raw%

(mia alexandra) #4

Hi, I’m trying to retrieve the content of an asset A from another asset B. The id of the asset A must be dynamic depending on a get … Configure the asset listing and make the root node and assetsSpacebar clicker per page settings dynamic . Go to the Details screen of the asset listing and select Acquire Locks. I am loading a html content from a file stored in assets folder and I want to replace some string (Loading…) in that html content , as i want.