Working with templates

Updated on 20-October-2016 at 10:16 AM

Business Catalyst End of life announcement - find out more details.

You can use page templates in Business Catalyst to manage the appearance of your site. For example, you can include a header, footer, and navigation bar in a template and then apply the template to most pages on the site. Each page with the template shares a header, footer, and navigation bar.

Templates let you easily update the appearance of your site. If you modify a template, the changes are reflected in all the pages that share the template.

Note: Templates let you design and reuse complete layouts. To reuse individual design elements, see Create and insert reusable content .

Page templates main view

Templates and pages

You've previously learned how to create a page . Now as you'll go forward you might discover the need to create pages in a large number, but where content doesn't completely change. For example, let's take a simple html structure:

<html>
<head>
</head>
<body>
Header(menu)
Hello, this is a welcome page!
Footer
</body>
</html>
If this was the main page of a basic site, you might want to have all the other pages looking just like this one (same header and footer), only with different content. One way would be to just duplicate the page each time you want a new one, but as the pages number increases, whenever you need to update any information in either header, menu or footer, you'll have to manually update each page. This is where templates come in. You can take the entire structure above, replace the variable content like "Hello, this is a welcome page!" with {tag_pagecontent}:
<html>
<head>
</head>
<body>
Header(menu)
&#123;tag_pagecontent&#125;
Footer
</body>
</html>
What you now see above is a template! Let's name it "Template_1"

Let's go further and create a new page, name it "Main" for example and populate it only with the intended content:

Hello, this is a welcome page!
Assign it the template you create above ("Template_1") and you're set!
For any new page you create you can just assign the same template (or create separate templates for differente sections of your website). The advantage to this is that whenever you want to update an item such as a menu item or footer information, you just modify the respective template, once, instead of every page containing that information.

Create a template and assign it to a page

How to create a template, what is the default and printer view template.

  1. Select Site Manager > Page Templates, and then click Add Template.
  2. Enter a template name.
  3. Specify whether it is the default template for your site. The default template is assigned to all content unless you specifically choose a different template or choose not to use a template.
  4. Add the template content, but do not delete the {tag_pagecontent} tag.

    The tag represents the editable region of the page. You add or edit the content of this region when working on specific pages. See Working with pages .

    Examples of template content include site menus, headers and footers, and other content that you want to display on multiple pages.

  5. Click Save Draft or Save & Publish.

You have now created a page template. To assign it to a page, do one of the following:

  • For an existing page, select Site Manager > Pages, and then click the page in the tree view to switch to editing mode.
  • For a new page, select Site Manager > Pages, and then click Add Page.
  • Select a template from the Template menu.
  • Click Save Draft or Publish.

Modify or delete a template

  • Select Site Manager > Page Templates, and then click the template name.
  • Modify the template content and click Save Draft or Save & Publish.

Note: Do not delete the {tag_pagecontent} tag, which represents the content of the page.

Templates are also used for...

Access any page template and you'll notice the "Assign this Template to..." button. Pressing it will open the allocation menu, from where you'll see that templates can be assigned to:

  • Web Pages
  • News
  • Blogs
  • Events
  • Catalogs
  • FAQs
  • Forums
  • Web App Items

Templates are also used for:

  • System Pages
  • System E-mails

Aside from this, the basic concept of a template, this time without the use of the pagecontent tag, is also used in:

  • E-mail Campaigns
  • Modules: through Module Templates
  • Menus, through Module Menu V2

Accessing the templates via sFTP

Whether you're using an external ftp client such as Filezilla or Adobe's Dreamweaver, you can access the templates by navigating to Root > Templates.

When using an FTP application other than Dreamweaver, for example Filezilla, you'll see three versions of each template, one for each media type: Desktop, Phone, Tablet

Check out this article for all the basics of using SFTP.

Check BC Gurus for a video-tutorial on building pages

BC Gurus - How to build BC site templates