2
votes

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 'Category' and

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

Returns a string with item's title (like 'Some Category'). But I need a URL or ID. Any suggestions?

2

2 Answers

0
votes

Try something like this :

<a>
    <xsl:attribute name="href">
        <xsl:value-of select="@Url" />
    </xsl:attribute>
    <xsl:value-of select="@Category" />
</a>
0
votes

Use disable-output-escaping, for example:

{less than symbol}xsl:value-of disable-output-escaping="yes" select="@Category" /{greater than symbol}