Quick Guide to creating a Component Template
This Quick Guide instructs you on the fundamentals of templating by walking you through the creation of your first Component Template, based on an HTML design we provide.
Before you begin
To perform this task, you must have the core software components of SDL Tridion installed and configured. Also, the WebDAV client needs to be set up, allowing you to browse the Content Manager organizational items structure from Windows Explorer.
About this task
After completing this Quick Guide, you will be able to use the Component Template to produce Component Presentations (rendered pieces of content) that look like the one pictured below.
The Web content your Component Template will produce is in HTML 5. You can change the resources to be compatible with other versions of HTML.
Step 1: Creating a Publication and uploading resources
Create a dedicated Publication for this exercise.
Procedure
- In Content Manager Explorer, create a new Publication called "Quick Guide to Templating" and create a basic structure for it. You can skip this step if you already went through the Quick Guide to creating a Page Template.
- In Windows Explorer, download the design zip file from this location: http://sdl.dist.sdlmedia.com/vms/distribution/?o=A3485AFB-EDCE-4980-9F3E-961E0815E43D
- Copy the files in this zip file into the organizational items of your new Publication (accessed through WebDAV) as follows:
- In Content Manager Explorer, navigate to /Building Blocks/System/Template Building Blocks/Design/. In that location, select the Create Ribbon tab and select New Template Building Block.
- In the dialog that opens, fill in Article Summary Design in the Name field.
- Select the Source tab, ensure that Template Type is set to Dreamweaver, and make the text box empty.
- Open the file Article Summary Design.dwt that you saved and copy-paste all of its contents into the text box. Then select Save and Close to commit your changes.
Step 2: Creating the Schema
Identify the editable parts of the piece of content and create a Schema with fields corresponding to those parts.
Procedure
Results
Step 3: Creating Components
Now that we have a Schema, we can create Components based on that Schema, one for each article in our design.
About this task
We first make Multimedia Components (containing the images), so that we can refer to them from our Components (containing the articles).
Procedure
Step 4: Creating the Component Template
Using the Template Builder desktop application, create a Component Template that uses the design item you created.
Procedure
Results
Step 5: Replacing hard-coded field contents with code
To replace the hard-coded field contents with code that dynamically retrieves the fields' contents from the Component being rendered, replace the contents with code.