I'm using a content query web part to display data from lists which are located in different subsites. So far I've been able to display items, but one of the requirements is that I've to display the ListName as a link where the user can click on List Name and be redirected to the list where he can see all items.
In side the if statement below, I would like to include the list name and the url to the list:
<xsl:if test="count(following-sibling::*)=0">
!!!!! Link to the List !!!!
</xsl:if>
So,how can I get the list url and the name? for example: the CQWP points to this list: http://dev/lists/myevents
I would like to show this in my xslt: <a href="http://dev/lists/myevents>myevents</a>
So, how I get the list url and the title in xslt? I tried $ListName
, but it throws an error.
whole code:
<xsl:template name="Events" match="Row[@Style='Events']" mode="itemstyle">
<xsl:variable name="SafeLinkUrl">
<xsl:call-template name="OuterTemplate.GetSafeLink">
<xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="DisplayTitle">
<xsl:call-template name="OuterTemplate.GetTitle">
<xsl:with-param name="Title" select="@Title"/>
<xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
</xsl:call-template>
</xsl:variable>
<div class="item link-item">
<xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>
<a href="{$SafeLinkUrl}"><xsl:value-of select="$DisplayTitle"></xsl:value-of></a>
<!-- End of Events -->
<!-- footer -->
<xsl:if test="count(following-sibling::*)=0">
!!!!! Link to the List !!!!
</xsl:if>
<!-- end footer -->
</div>
</xsl:template>