6

There is a List with Lookup field. And there is a CQWP web part which uses this list as a Source and uses custom XSL style added to Itemstyle.xsl. And there is a problem how to render this field as a link?

Field name is Vegetable and

<xsl:value-of select="@Vegetable" />

Returns a string with item's title (like 'Potato'). Any suggestions?

UPDATE I've found an article with similar problem. And here is a comment form it:

We raised a call with Microsoft PSS in the end and we’ve been told today by PSS after consulting with the SharePoint dev team that this is a known issue and that Custom Fields using the People or Groups field type do NOT work with the CQWP, only out of the box fields.

The workaround above does work, however further tests show it’s not reliable and is very situational.

1
  • You shouldn't put the answer inside the question. You should put your answer in the answer field, mark it, so it'll be closed
    – XristosK
    Sep 14, 2014 at 15:53

1 Answer 1

1

Have you tried like this?

<a href="/Lists/lookuplist/dispform.aspx?id={substring-before(@Vegetable,';#')}" ><xsl:value-of select="substring-after(@Vegetable,'#')" /></a>
1
  • For some reason the value of attribute Vegetable is like 'Potato' but it should be like 'Potato;1'.
    – Serhiy
    Sep 6, 2012 at 2:09

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.