Message Boards
How do I display a selected image in asset publisher template?
How do I display a selected image in asset publisher template?
New Member Posts: 2 Join Date: 7/8/20 Recent PostsI am trying to access an image that would have been selected in a web content structure and display it an asset publisher template. I created the template with the code below but instead of getting the image location I end up with a list. How would I access the location so that the images show? Thanks
<#assign
artImg =
saxReaderUtil.createXPath("dynamic-element[@name='Imagean48']")
/>
<#assign
journalArticle =
renderer.getArticle()
document =
saxReaderUtil.read(journalArticle.getContent())
artImgCont =
artImg.selectSingleNode(rootElement).getStringValue()
/>
<img src="${artImgCont}">
<img src=" {" classpk":1923313,"groupid":"1912582","name":"spc_desktop_welcome_image3_benefits.jpg","alt":"man="" in="" suit","title":"spc_desktop_welcome_image3_benefits.jpg","type":"document","uuid":"db10a245-881c-d09c-ab64-4aeebc1581f0","fileentryid":"1923313","resourceprimkey":"2474428"}="" "="">