Wednesday, 14 March 2018

Content Query Webpart

Create Custom XSLT template  example

 <xsl:template name="RecentUploads" match="Row[@Style='RecentUploads']" 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="SafeImageUrl">
            <xsl:call-template name="OuterTemplate.GetSafeStaticUrl">
                <xsl:with-param name="UrlColumnName" select="'ImageUrl'"/>
            </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 style="border-top:1px solid #ccc;padding:1% 0% 2% 0%;">
        <xsl:variable name="PointofContact" select="@PointofContact"></xsl:variable>
        <xsl:variable name="Linktosource" select="@Linktosource"></xsl:variable>
        <div class="divTopRow">
 
   
    <span style="font-weight:bold"> <xsl:value-of select="$DisplayTitle"/></span> <span> by </span><span style="font-weight:bold"> <xsl:value-of select="@PointofContact" disable-output-escaping="yes" /></span>
        </div>
        <div style="padding-top:1%;text-align:justify">
        <xsl:if test="string-length($SafeImageUrl) != 0">
        <div class="image-area-left contactlist-image-left">
         <img style="height:60px;width:60px" src="{$SafeImageUrl}" title="{@ImageUrlAltText}"/>
        </div>
      </xsl:if>
      <div style="min-height:61px">
      <xsl:value-of select="@Description"  disable-output-escaping="yes" />
      </div>
     
        </div>

        </div>
       
     
    </xsl:template>
---------------------------------------------------------------------

No comments:

Post a Comment