-
Notifications
You must be signed in to change notification settings - Fork 14
Installing the DD4T templates
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).
- 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!
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)
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!
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.
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.