Populate slot with content

I have been searching for a way to automatically populate a slot with content but I can’t seem find a way to do it without the slot being navigation related.

In the code below I am trying to populate an image slot with an image contained within the content item being displayed. Normally I would just wrap the image input field with the appropriate image tag code but I wanted to leverage an image snippet template that has already been created, this keeps everything consistent if that snippet template ever changes.

Can this be done? Am I on the right track?


#__slotsetup("erauLandingImage" "template=erauSnImageLeft")##
#set($putInSlot = $sys.item.getProperty("rx:uploadfilephoto"))##
#set($sys.currentslot.relresults = $rx.asmhelper.assemble($putInSlot,$sys.currentslot.slot,$completeparams))##
#slotItem($putInSlot)##
	<body
    	<div id="page_copy"
        #slot("erauLandingImage" "" "" "" "" "template=erauSnImageLeft")##


Thanks,

Steve

Are you trying to display a link to an image that is contained in a field on the same content item?

If so, it’s not necessary to add them to a slot, just assemble the link with $rx.location.generate().

No I would like to display the image on the page as if it were being called from a slot. Instead of copying the code in my erauSnImageLeft template and using it directly on the page I am trying to use the slot like an include item that just wraps the image with the erauSnImageLeft template.