Hi I've added a CQWP and edited the item.xslt to provide a new Item Style. In the webpart properties (Fields to display) I've added columns for Image, Title and Description.

The CQWP is expecting a path like /sites/siteA/doclib/image1.jpg for Image field.

However I dont want to provide the full path in the column (text) but only the library and filename (/doclib/image1.jpg)

This is because I want to create a site template and having a absolute path wont work. I've tried making the list column equal ../doclib/image1.jpg but that doesnt work.

Can the webpart be edited to provide the first part of the path dynamically like /sites/currentsite and append the incoming remainder of /doclib/image1.jpg?


1 Answer 1


In item.xslt, first define parameter <xsl:param name="HttpVDir"/> then before relative URL of your image, use the value <xsl:value-of select="$HttpVDir" /> to get the URL of the current website that contains the list.

XSLT Global Parameters

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.