# Building a Template

# Template Concepts

Templates in Flex are based on templates in Sitecore. When you create a template in Flex, you are creating a template and its standard values based on the seed "Page" template located at /sitecore/templates/Project/Website/Page Templates/Page

When you edit a template in Flex, you are actually editing the shared presentation details of the template's Standard Values, as well as creating the local data structure for your page at this location: /sitecore/content/Data/Page Template Data

# Creating a new template

For those with Flex Developer or Admin access, the template editor will appear in the main menu at the top. Follow the wizard for creating a new template, setting it up just like a page.

Sample Template

Building a template is a lot like building a page, with these two caveats:

  • Everything you put on the template is shared globally and cannot be edited at the page level
  • You must have at least one "drop zone," which allows page editors to drag and drop content in. The drop zone is in the insert menu under Structural Components> Template Editor> Drop Zone

# Editing a template

Editing a template is just like editing a page, but affects all pages using that template.

Do this only with extreme caution, especially if there are pages using the template

In standard Sitecore, editing a template is usually done by developers, but we've given you the power to do by yourself in Flex. This doesn't mean you necessarily should do it in all situations.

Because editing a template can have far reaching effects, here's a general guide on what's safe and not safe to do when editing a template:

# Generally Safe

  • Modifying the order of base level components (e.g. moving a hero that was above your drop zone to under it)
  • Adding or removing regular components (e.g. add a split, remove a hero from any level)

# Generally NOT Safe

  • Adding or removing any number of layout or placeholder components
  • Moving any layout or placeholder components

This is because these placeholders and layouts dynamically create placeholders in Sitecore for you, and when modified, existing pages can have their placeholders disappear.