Hi Folks
From the metadata schema I am pulling in id numbers of numerous related assets as an array
Using ‘json_decode’ I am able to display a list of the id numbers but what I want to do is display the contents of the selected pages ‘assets_raw’
However, with all the code I have played around with I only seem to be able to display a string that looks like %globals_asset_contents_raw:####% rather than the content itself.
The code I am using is this;
//Get all of our assets into an array variable
const assets = %asset_metadata_page-select^json_decode^as_asset:asset_name,asset_url,asset_assetid%;
if(assets.length > 0){
//Loop through each asset in the array
assets.forEach(function(asset){
//THIS RETURNS ASSET IDS DISPLAYED IN SEPARATE DIVS
//document.write('<div class="nest-item">'+asset.asset_assetid+'</div>');
//I WANT THIS TO RETURN THE CONTENTS OF EACH ASSET
document.write('<div class="nest-item">%globals_asset_contents_raw:'+asset.asset_assetid+'%</div>');
});
}
can anyone assist and tell me what I am doing incorrectly
Many thanks
p