Extracting the location of image in a slot when publishing to a database

Hi,

I was wondering how to extract the location of the first media item (could be a video or image) in a slot within my database publishing template. I was wondering whether it would be possible to do something with:

$slotcontent --> $user.psoSlotTools.getSlotContents($sys.assemblyItem,“TitleMediaSlot”,$params);
$row.cstTitleMedia --> $user.psoSlotTools.getSlotPropertyValues($slotcontent, “image_filename”);

But that currently would only publish out the filename so i’m wondering how i could extend it to retrieve the whole path, as you would with:

$rx.location.generate($sys.assemblyItem,‘bImage’)

Thanks.

This may help / point you in a direction… http://forum.percussion.com/showthread.php?2604-Publish-location-for-a-slot-item-on-item-being-database-published&highlight=location+database

Yes, I would imagine they did something like the following:

$ImageURLTemplate --> $sys.asm.findTemplateByName(“sImageSlotContents”)
$pageTemplate --> $sys.assemblyItem.clone()
$pageTemplate.setTemplate($ImageURLTemplate )
$result --> $sys.asm.assemble($user.psoListTools.asList($pageTemplate)).get(0)
$resultText --> $result.toResultString()
$resultBody --> $rx.doc.extractBody($result)
$row.cstImageURL --> $resultBody.trim()

But what if I just wanted to get the filename of the image and it’s location rather than the full link? Would I have to have a template with just the image filename field in it, so is there a better way to achieve this? Any examples would be great :).