Skip to content

Installing the DD4T templates

Quirijn edited this page Dec 31, 2019 · 2 revisions

This page describes how to install the template building blocks that are part of DD4T, and how to use them to create templates.

You should have an installation of SDL Tridion Sites / SDL Web (version 8.1 or higher).

Downloading and running the installer

  • Download the zip package from here and unpack it.
  • Be sure to use the template installer that matches your Tridion version
  • Run the install-templates.bat and follow the steps.

It couldn't be easier!

Create a template metadata schema

This step is not strictly necessary, but it's recommended. If you don't, the names of the templates are mapped to the names of Razor views in your web application.

Create a metadata schema called 'DD4T Template Metadata', and add the following fields:

  • a single-value text field called 'view' (XML name)
  • a single-value text field called 'controller' (XML name)
  • a single-value text field called 'action' (XML name)

Creating your first Page Template

Open the SDL Tridion Template Builder (if you don't have it installed, start Internet Explorer and browse to any Tridion CME, then click on the Tools ribbon and download the template builder from there).

Create a page template, give it any name you like, and add the 'Generate dynamic page' DD4T template building block to it. Save and close the template.

Open the page template again, but this time from the CME. Assign the DD4T Template Metadata schema to it, and make sure the 'view' field has a short, logical name. The web application expects a Razor view with that same name, so don't include spaces and other funny characters. Also, do NOT add '.cshtml'. Just the file name part of the view without the extension!

Creating your first Component Template

Create a component template, give it any name you like, and add the 'Generate dynamic component presentation' DD4T template building block to it. Save and close the template. Open the component template again, but this time from the CME. Link it to one ore more schemas. Also, assign the DD4T Template Metadata schema to it and supply a view name (see above). Don't worry about the controller and action fields for now.

What's next

You are now ready to create some pages and publish them. Once you have done that, you can start building a .NET application or Java application to present your content in an MVC web site.