Component Templates
Component templates are selected when the component is inserted into a page file, illustrated in the screencap below. When you select a component to insert into the page (A), the component template drop-down menu (B) will then activate and you can select a component template to apply.
All components have at least one component template, but some have multiple component templates. The General Content component is a good example of a component with multiple component templates. As we can see in the screen caps below, the same exact component can be used in multiple ways. In the examples below, the fields labeled 1 & 2 on the left side (the component) are rendered differently on the page when different component templates are applied.
This example shows a General Content component with the "General Content" component template applied. This tells the system to render the component on the page with the Title field as the page's headline (#1), and the Content field as the body of the page (#2).
Using the exact same General Content component as an example, we now see what happens if the "Feature Spotlight (with H2 Heading)" component template is applied. In this case, the system is instructed to take the content in the Feature Title field (#1) and display it on the page as a spotlight headline and link. It also instructs the system to take the Feature Description field (#2) and render that as the spotlight's description.
As you can see in the example above, the same component can be used in many different ways. Specific instructions for applying component templates, and examples of all component template options, can be found in the Component Guides in the Tridion User Guide.
Page Templates
Similar to component templates, page templates also dictate how content is used on a page. However, rather than dictating how specific bits of content are rendered, page templates control the overall layout of the page and what components are allowed to be used on the page.
For example, let's examine this Toggle List page:
The page template tells the page to render in the following way:
- It inserts the Header at the top of the page, with the Navigation immediately below it
- The breadcrumb appears beneath the Navigation
- In the body content area, the Left Navigation is inserted on the left
- Also in the body content area, the Components inserted by the user appear on the right.
- (Not pictured) The Footer is inserted at the bottom of the page
Most page templates follow this same general model (inserting the Header, Navigation, breadcrumb, Left Navigation, Components, Footer), although there are some minor exceptions.
How the Page Template Interacts with Component Templates
In addition to displaying the content on the page, as described above, the page template also defines which components and component templates can be inserted into the page. Some page templates, like Flex Layouts, are very flexible and your options for customizing them are numerous. Other pages, like the A to Z Index, are very restrictive and will only accept and display a very small number of components.
Using the example above, in the area highlighted in item #4, two Toggle List Item components were inserted into the page and the Tab component template was applied to both, thus rendering two tabbed items on the page. However, if the Anchor Links component template had been applied to the Toggle List Item components, the page would have failed to publish. This is because the page template for this page does not allow the Anchor Link component template to be used. You can verify this by visiting the Page Guide for the Toggle List / Tab Page and viewing the Technical Specifications for that page type - it confirms that Anchor Links are not an accepted component template:
The Page Guides section of the Tridion User Guide lists all the available page templates, the steps for creating each type of page, and the technical specifications for each page template (which components are allowed, how many of each, etc). If you are ever in the process of creating and updating a page, and either the page is failing to publish or content you have inserted is not showing up, double check the technical specifications for the page template being used. Either the page template or component templates you're using may be the culprit.