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.
Could you try to output the link href to a paragraph and make sure the URL that is being generated is correct?
Hi Beau, Thank you for the response. Mine is test data the URL is ‘http://www.google.com’ it shows blank in output Just tried another option as below But no luck 🙁 Kindly share working sample / link where hyperlink is shown.