Saturday, January 18, 2014

ItemStyle.xsl - Clickable Title Showing Default View Form In Modal

This is customized item template for ItemStyle.xsl SharePoint 2013 CQWP showing only clickable title that shows default view form in modal. You can just copy and paste in ItemStyle.xsl file at the bottom (of course before </xsl:stylesheet> :) ) to test it:



<xsl:template name="ItemTitlePoupView" match="Row[@Style='ItemTitlePoupView']" mode="itemstyle">
    <xsl:variable name="SafeLinkUrl">
        <xsl:call-template name="OuterTemplate.GetSafeLink">
            <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
        </xsl:call-template>
    </xsl:variable>             
    <p class="anntitle">
        <a>
            <xsl:attribute name="href">
              <xsl:value-of select="concat(&quot;javascript:SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', {url:'&quot;,$SafeLinkUrl,&quot;'})&quot;)"/>
            </xsl:attribute>                   
            <xsl:value-of select="@Title"/>
        </a>
    </p>
</xsl:template>




No comments: