In a previous post, we listed several common terms used in Sitefinity, and what they mean. One such term was “template”. The definition was as follows:
A template is a collection of layout elements. It contains the structure of a webpage’s look and feel. In Sitefinity, you apply a template to a page after it’s been created. It then takes on the structure and characteristics you want to see. Content is entered after you set the page’s template. Templates are also used on widgets.
But there’s more to Sitefinity’s templates than this. In fact, this is the first post in a new Sitefinity Insider series focused on templates.
Today we’re starting with the most fundamental template: the Page Template.
Definition of a Page Template
We’ve used templates in different software applications for years now. Document templates in Word, spreadsheet templates in Excel, etc. A Page Template in Sitefinity does much the same thing for a webpage – it lays out a predefined page structure for you to fill in.
This is not the same as a theme, though. A theme is a collection of styles and colors which are applied to pages using a certain template. In Sitefinity, themes are part of Page Templates.
Let’s use this image to illustrate:
Page Templates are the walls of a house.
Themes are the colors used on the house’s walls.
Content, what people read on a webpage, is the furniture inside the house.
How Sitefinity Uses Page Templates
Page Templates provide the foundation for all of the pages on a website. Every time you create a page in Sitefinity – Home, Services, Product 1, Contact Us – it’s built on a Page Template.
You manage templates through Sitefinity’s Templates page. There’s no limit to the number of page templates you can create, but we recommend you create no more than 5 for your website.
Examples of Page templates we’ve built for customers are:
- Home Pages
- Standard Webpage (about 50 varieties!)
- News Pages
- Galleries (Photos, Videos, Portfolio Samples, etc.)
Page Template 101: What do I do with these?
Every page created in your website must use a template. Accordingly, you’ll need at least one before you start creating pages. Sitefinity does include several “basic” templates by default. You can use these, or customize new ones (see the next section for more on that).
When creating new pages on a website, you’re prompted to choose a Layout before you can enter content. Right here:
In this case, I’ve selected a page template named “SecondLevel.” Or, if I want something else, I can click the Select Another Template button and see this popup window:
Here you see 3 custom templates, and several “basic templates” below. Select one with a click.
We normally use a separate template for the Home page and other webpages on a website. Why? It’s easier to make the homepage unique. Also, if you want to modify the other webpages’ layout, you don’t hurt the Home page layout at the same time.
Customizing Page Templates
You don’t have to stick with the basic templates. No, you can customize the Page Templates within Sitefinity. Or use Page Templates others have created. Or make your own!
There are 3 ways to create a Page Template.
- Using the Sitefinity Template Builder
- Use a “Master Page” (the basis for page templates)
- Uploading a Custom Page Template
If you’d like to use a pre-made Page Template created by professional developers, here are some to try out: Themes and Templates – Sitefinity Marketplace
And of course, you can hire a Sitefinity developer to create custom page templates. We include custom templates in all of our customer website projects, but we’ve designed page templates separately too.
Caveats & Cautions
Since the Page Template is a foundational element site-wide, there are a few things to keep in mind when using them.
First and foremost – Changing the Page Template affects ALL pages which use it. If you want one page to have a different structure than the others, you must use a separate page template on that page.
This is why it’s good practice to review all the pages which use a Page Template, after you modify the template. Sometimes a certain page will interpret the change differently, and you may need to fix it.
Second – Make sure your Page Templates are responsive BEFORE building pages & adding content. Since the Page Template is the structure on which pages are created, you must make sure they render well on phones, tablets and desktops before anything else!
Otherwise your pages will become a jumble on mobile devices and you’ll lose development time fixing the templates.
For more details on Page Templates, visit Sitefinity’s documentation: Page Templates (Overview) – Sitefinity Documentation
Next up we’ll discuss the Blog Template.
If you know anyone who would benefit from receiving our Sitefinity CMS Blog posts, they can sign up on the right and receive them via email once a month.