Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question
    
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 at 15:53

1 Answer 1

Have you tried like this?

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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