in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

Spiral Out

August 2008 - Posts

  • Content Query Web Part Display all fields + values

     I was using a custom xslt to display all the field names  in Content Query Web part. Very useful to debug while writing custom style sheets.

     

    I needed to see values along with it so this XSLT will display values along with Field names

     <code>

    ---------------------------------------------------------------------------------- 

     <xsl:template name="AllFields" match="Row[@Style='AllFields']" mode="itemstyle">
        <xsl:param name="CurPos"/>
              <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>
            <xsl:variable name="LinkTarget">
                <xsl:if test="@OpenInNewWindow = 'True'" >_blank</xsl:if>
            </xsl:variable>
            <div id="linkitem" class="item">        
                <xsl:for-each select="@*">               
                        <span style ="font:bold">    <xsl:value-of select="name()" /> </span>  : <xsl:value-of select="."/> <br/>                    
                  </xsl:for-each>
            </div>
            </xsl:template>

    ---------------------------------------------

    </code>



Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts