0

I am quite new to Content Query WebPart. I have a list which as a ‘Hyperklink or Picture’ column. I have added below markup in itemstyle.xsl to show hyperlink

<xsl:template name="CQWPStyle" match="Row[@Style='CQWPStyle']" mode="itemstyle">
 <html>
<table width="100%">
<xsl:if test="count(preceding-sibling::*)=0">
    <tr>
    <td width="10%" valign="top"><div class="item"><b>Title</b></div></td>
    <td width="10%" valign="top"><div class="item"><b>Address</b></div></td>
    <td width="10%" valign="top"><div class="item"><b>Area</b></div></td>   
    <td width="10%" valign="top"><div class="item"><b>ChoiceCol</b></div></td>  
    <td width="10%" valign="top"><div class="item"><b>DateTimeCol</b></div></td>    
</tr>
</xsl:if>
<tr>       
    <td width="10%" valign="top">
        <div class="item">
            <xsl:value-of select="@Title" />
        </div>
    </td>
    <td width="10%" valign="top">
        <div class="item">
            <xsl:value-of select="@Address" disable-output-escaping="yes"  />
        </div>
    </td>
    <td width="10%" valign="top">
        <div class="item">
            <xsl:value-of select="@Area" />
        </div>
    </td>
    <td width="10%" valign="top">
        <div class="item">
            <xsl:value-of select="@ChoiceCol" />
        </div>
    </td>
        <td width="10%" valign="top">
        <div class="item">
            <xsl:value-of select="@DateTimeCol" />
        </div>
    </td>
    <td width="10%" valign="top">
        <div class="item">          
            <!--Variable declared to read the link from the column Link-->

            <xsl:variable name="ActualLink" select="substring-before(@HyperLinkCol,',')"/>
            <xsl:variable name="FriendlyName" select="substring-after(@HyperLinkCol,',')"/>

            <!-- Image to the hyperlink-->

<a href="{$ActualLink}"><xsl:value-of select="$FriendlyName"/></a>



        </div>
    </td>        
</tr>
</table>
</html>

All other columns show as expected. However, the hyperlink column does not show. Kindly let me know, what I am missing.

(Visited 55 times, 1 visits today)
Add a Comment