Image URL not correct

Hi,

We have a snippet for images that contains

<img src="$pagelink" ... etc >

and in the bindings for the snippet

$pagelink = $rx.location.generate($sys.assemblyItem, "cuBnImageSmall")

But the $pagelink variable is always relative to the path of the item containing the image, rather than the path of the published image itself.

Is there an error in how we’ve constructed it?

Thanks,
Nick.

Nick,

The binding variable name $pagelink is used in the #fieldlink macro. You may be running into a naming conflict. Try renaming your binding variable (perhaps simply “$link” or “$image”).

RLJII

Thanks, RLJ, but that didn’t solve the problem.

The images preview okay, it’s just when we come to publish that the paths are incorrect.

Hi Nick

This was due to the system originally being 5.71 and not heavily reliant on the site and folderids. If you update the Related_Content_By_Variant display format and add in the folderid and siteid columns these will then be added to the slot item and the folder path will be calculated based on it’s own folder id and not it’s parent.

Cheers
James

One of the senior members on here - Jimbo - solved the problem for us.

Our display format “Related Content By Variant” was not returning the folder_id of the item we searched for and so inheriting from the current folder.

Nick.