Types of Template Building Blocks

A Template Building Block can contain a C# fragment, a .NET assembly, an Adobe Dreamweaver Template or an XSLT stylesheet.

C# fragment

A snippet of C# code entered or pasted directly into the Source tab of a Template Building Block dialog in the Content Manager Explorer Web interface. Use C# fragments for small, simple operations on the package. The advantage over .NET assembly is that you do not require a development IDE to create C# fragments.

.NET assembly

A .NET assembly (DLL file) that you create, code and debug in Visual Studio and then upload in a Template Building Block. Use .NET assemblies for more complex operations on a package. The advantage over C# fragments is that you can work in a development IDE, with all the added advantages such as code completion and debugging functionality.

Adobe Dreamweaver Template

A valid template for Adobe Dreamweaver (.dwt file) that you create and add to a Template Building Block in Content Manager from within Adobe Dreamweaver. Use Adobe Dreamweaver Templates to specify the visualization of content. A Compound Template normally contains exactly one Template Building Block based on an Adobe Dreamweaver Template.

XSLT stylesheet

A working XSLT stylesheet entered or pasted directly into the Source tab of a Template Building Block dialog in the Content Manager Explorer Web interface. Use XSLT stylesheets to perform any transformation of XML into XML. For example, you can use a Template Building Block that contains an XSLT stylesheet to produce XHTML. Such a Template Building Block could replace a Template Building Block containing an Adobe Dreamweaver Template.

Be careful not to confuse an XSLT stylesheet Template Building Block with an XSLT stylesheet used as a Dynamic Template. The difference between the two is as follows:

  • When used as a Template Building Block, an XSLT stylesheet helps to transform Content Manager content into publishable content at publish time.
  • When used as a Dynamic Template, an XSLT stylesheet is applied at request time to content published as raw XML. Note that in order to publish content as raw XML, you will need an XSLT stylesheet Template Building Block.