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.

  • 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 '14 at 15:53
1

Have you tried like this?

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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