XSLT Renderings

XSLT Renderings

XSLT Renderings

  • The combination of a definition item and XSLT code file that transforms content from Sitecore’s XML representation to an appropriate markup language, such as HTML
  • Transform content to presentation using XSL Templates
  • Used to displays a small section of a page using XSLT code

Binding XSLT Renderings

  • Can be bound to a Sitecore layout or sublayout
  • Can be statically referenced using a Sitecore Web Control declaration
  • Can be dynamically bound to a Sitecore placeholder so the layout or sublayout can be reused with other renderings

XSLT Rendering Definition Items

  • Content tab shows item definition, including the path to the associated .xslt  file

Sitecore XSLT Renderings Guidelines

  • Use Developer Center instead of Visual Studio to write XSLT code if you want to immediately preview the output and don't  require Intellisense support
  • Favor the $sc_item DataSource parameter over the $sc_currentitem parameter
  • Avoid //, descendant and descendant-or-self axis in XSL renderings