Building the Site’s
Data Infrastructure
1
Module Objectives
By the end of this module, you will be
able to:
Describe the templates building blocks.
Name the field types and their purpose.
Give examples of how you use source fields.
Identify when you need to use template inheritance.
Apply template inheritance to new and existing
templates.
List what you should consider when you apply
inheritance to templates.
Describe the purpose of the Standard template.
Use the Template Manager to build and configure a
site infrastructure.
State the importance of setting up icons on
templates.
© 2001-2016 Sitecore Corporation A/S. All rights reserved. Sitecore® and Own the Experience® are registered trademarks of Sitecore Corporation A/S. All other brand and product names are the property of their respective owners.
2
Template
Building Blocks
Templates
Common Field Types
Field Source
Grouping Fields with Field Sections
Template Icons
Analyzing the HTML Templates
Template Building Blocks
Templates
Defines type of item:
Fields
Field sections
Icon
© 2001-2016 Sitecore Corporation A/S. All rights reserved. Sitecore® and Own the Experience® are registered trademarks of Sitecore Corporation A/S. All other brand and product names are the property of their respective owners.
5
Common Field Types
Text:
Link to multiple items: Other:
Single-Line
Multilist Text Date / Datetime
Multi-Line
Treelist Text Checkbox
Rich Text
Checklist General Link Field
Media:
TreelistEx
Image
File
Link to single item:
Droplink
Grouped Droplink
Droptree
© 2001-2016 Sitecore Corporation A/S. All rights reserved. Sitecore® and Own the Experience® are registered trademarks of Sitecore Corporation A/S. All other brand and product names are the property of their respective owners.
6
Field Source
Link field types: define choices editor
can select from
Image/File: browsing location in the
media library
Rich Text: toolbar configuration for
the Rich Text Editor
© 2001-2016 Sitecore Corporation A/S. All rights reserved. Sitecore® and Own the Experience® are registered trademarks of Sitecore Corporation A/S. All other brand and product names are the property of their respective owners.
7
Grouping Fields with Field Sections
An organizational structure for
business users.
Can be expanded or collapsed for easy
navigation in Content Editor.
Not used by developers when coding.
© 2001-2016 Sitecore Corporation A/S. All rights reserved. Sitecore® and Own the Experience® are registered trademarks of Sitecore Corporation A/S. All other brand and product names are the property of their respective owners.
8
Template Icons
© 2001-2016 Sitecore Corporation A/S. All rights reserved. Sitecore® and Own the Experience® are registered trademarks of Sitecore Corporation A/S. All other brand and product names are the property of their respective owners.
9
Analyzing the HTML Templates
Heading
Intro
Image
Description Hours
Location
Job Type
Requirements
Has bullet points – styling –
will need a Rich Text Field
If this footer text is common
across all pages it does not
relate to a Job Details page.
It will be stored elsewhere.
© 2001-2016 Sitecore Corporation A/S. All rights reserved. Sitecore® and Own the Experience® are registered trademarks of Sitecore Corporation A/S. All other brand and product names are the property of their respective owners.
10
Demo: Creating a Template
In this demo, you will learn how to create a
template with Sitecore to define a schema of
the data to store.
Lab: Creating Templates
In this lab, you will create some of the
necessary templates to store the content for
the site. You will start by creating a new folder
where to store all your templates. You will
then create a few templates.
Template Inheritance
Template Inheritance
Sitecore System Fields
Recommended Practices
Final Template Design
Template Inheritance
Template Inheritance
Site JobDetails GenericPage Footer
Heading Heading Heading Main Item
Intro Intro Intro Copyright
Image Image Description Other Links
Description
Requirements
Hours
Job Type
Location
Related Jobs
Duplication of fields = Harder to maintain
Solution: Template inheritance
© 2001-2016 Sitecore Corporation A/S. All rights reserved. Sitecore® and Own the Experience® are registered trademarks of Sitecore Corporation A/S. All other brand and product names are the property of their respective owners.
15
Sitecore System Fields
All templates inherit from the Standard
Template.
It defines the Standard Fields: system
fields.
Normally hidden.
© 2001-2016 Sitecore Corporation A/S. All rights reserved. Sitecore® and Own the Experience® are registered trademarks of Sitecore Corporation A/S. All other brand and product names are the property of their respective owners.
16
Recommended Practices
_Base Page
Avoid repeating field names.
Heading
Do not create cyclic Intro
inheritance references.
Use editor-friendly names. Site
Heading
Work with conventions.
Don't forget to set icons!
_Base Page _Base Image
Heading Image
Intro
© 2001-2016 Sitecore Corporation A/S. All rights reserved. Sitecore® and Own the Experience® are registered trademarks of Sitecore Corporation A/S. All other brand and product names are the property of their respective owners.
17
Final Template Design
_Base Page _Base Image _Base Description
Heading Image Description
Intro
Site JobDetails GenericPage Footer
Requirements Main Item
Hours Copyright
Job Type Other Links
Location
© 2001-2016 Sitecore Corporation A/S. All rights reserved. Sitecore® and Own the Experience® are registered trademarks of Sitecore Corporation A/S. All other brand and product names are the property of their respective owners.
18
Demo: Creating Template
Inheritance
In this demo, you will learn how to make a
template inherit from another and check
which fields it is inheriting.
Lab: Clean Our Templates
Now that you know about template
inheritance, you need to clean up your
template design to avoid redundant fields.
Review Questions
Q What should you define in a Q What field type would you Q What happens if you use
template? use to store formatted the same field name in a
HTML? template that is already
used in a base template?
Q What is the name of the Q Why should you avoid Q What would you use the
template all templates defining the same field Field source for in the
should inherit from? multiple times in more than following field types: Image,
one template? Rich Text Field, Droplink?
© 2001-2016 Sitecore Corporation A/S. All rights reserved. Sitecore® and Own the Experience® are registered trademarks of Sitecore Corporation A/S. All other brand and product names are the property of their respective owners.
21
Module Summary
We have just learned the basics of the templates, including:
The building blocks of templates.
The inheritance model of templates.
Using the Template Manager.
© 2001-2016 Sitecore Corporation A/S. All rights reserved. Sitecore® and Own the Experience® are registered trademarks of Sitecore Corporation A/S. All other brand and product names are the property of their respective owners.
22