Nesting a rest resource asset in content container template - global keywords not working

(Erwin Strobel) #1


I’m trying to get a rest resource, that is nested in a content container template pain layout, to recognise keywords from the metadata of the content container in the URL. It appears that when global variables are used, it attempts to pull the data from the parent standard page, not on the content container level. Which is a bit strange, as when standard pages etc are nested this way, global keywords pull the data from the content container itself.

I have attempted to get this to work by both directly nesting the rest resource with a get variable, and via globals keyword with get parameter.

any help would be much appreciated.

(Bart Banda) #2

Similar approach to what I answered in Container template with metadata fields - not working with asset listing

Something like:

<script runat="server">
print('%' + 'globals_asset_contents_raw:1234^with_get:url=' + '%asset_metadata_url%' + '%';

Where 1234 is the asset ID of the REST Resource.