Simple ItemStyle.xslt

08/02/2013 13:00

Simple item style file, displays one hyperlink with link and description (url field as input)

 

<xsl:stylesheet
  version="1.0"
  exclude-result-prefixes="x d xsl msxsl cmswrt ddwrt"
  xmlns:x="https://www.w3.org/2001/XMLSchema"
  xmlns:d="https://schemas.microsoft.com/sharepoint/dsp"
  xmlns:cmswrt="https://schemas.microsoft.com/WebParts/v3/Publishing/runtime"
  xmlns:ddwrt="https://schemas.microsoft.com/WebParts/v2/DataView/runtime"
  xmlns:xsl="https://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
  <xsl:output method="html" indent="yes"/>
  <xsl:template name="Default" match="*" mode="itemstyle">

    <div class="itemWraper">
    
     <xsl:variable name="UrlLink" select='substring-before(@categoryLink, ",")'></xsl:variable>
     <xsl:variable name="UrlDescription" select='substring-after(@categoryLink, ", ")'></xsl:variable>
     <div class="item link-item customClass">
         <a href="{$UrlLink}" target="_blank">
           <xsl:value-of disable-output-escaping="yes" select="$UrlDescription"/>
         </a>
     </div>    
    </div>
  </xsl:template>
</xsl:stylesheet>