DevHub Docs
  • Welcome
  • Analytics
    • What events are tracked automatically?
    • Custom events
    • Google Analytics
  • API documentation
  • Domains
    • Registering a new domain
    • Renewing a domain
    • Pointing an existing domain
    • Pointing a subdomain of an existing domain
    • Transfer a domain
      • Transfer a domain to another registrar
    • Validating your domain
      • Validate with Google Webmaster Tools
    • Domain expiration process
  • Email accounts
    • Hosted email (rackspace)
      • Configure email clients to use POP or IMAP
  • Forms
    • Form and field options
    • Using fieldsets
    • Spam filtering
    • Configure SMTP For outbound emails
    • Using Marketo forms
  • Google Sheets
  • Hosting options
    • Embed pages
    • Wordpress plugin for path override
    • Server path override
      • Apache configuration
      • IIS configuration
      • NGINX configuration
    • CDN (content delivery network) support
  • Maps
    • Location finder
    • Map options explained
    • Google Maps API keys
  • Privacy
    • OneTrust integration
    • Cookies
  • Reverse proxy
    • Privacy and security
    • Proxy Configuration
    • Proxy Gating
    • Form lead tracking
    • Blocking and Whitelisting
      • Whitelisting Options
      • Google Ads rejections or disapprovals
      • 3rd Party Services/Widgets
      • Common Security System Restrictions or Domain Errors
  • SEO
    • Schema.org support
    • Sitemap XML
    • Enable No Index
  • Site builder
    • Getting Started
    • Images and video
    • Pages and content
      • Using page drafts
      • Adding Text
      • Adding and Managing Pages
      • Adding Images
      • Page templates and Templated pages
      • Maps
    • Redirects
    • Site Settings
    • Style Options
    • Adding a Business and location
    • Adding a site
    • Adding a user
    • Adding Custom Forms
    • Adding HTML to Sites or Pages
    • Blogs
  • SSL and security
    • SSL Troubleshooting
    • SSL certificate install options
      • Use your own purchased SSL certificate
    • Enable HTTPS for Sites and Proxies
  • Support
    • Creating a Zendesk account
    • Ticketing submission workflow
    • Builder URL and Site ID
  • Themes and custom templates
    • Getting started
    • Using macros
    • Using custom fields
    • Using URL parameters
    • Hours of operation
    • Using date and time in templates
    • Template variables
    • Site Builder Markup
      • Avoiding Site Builder CSS and HTML duplication
    • Example themes
      • Location focused page with bootstrap
      • Store locator theme example
    • Advanced Examples
      • Theme module templates
      • Static Google maps
      • Content translations
      • Page navigation
      • Override page title and meta tags
      • Adding line breaks to content
      • Get objects
      • Handling boolean values
      • Right to left languages
      • Access current URL
      • Social sharing links
      • Standard filters
      • Serializing data to JSON
      • Form events
      • Schema.org FAQ utility
  • Trace technology
    • What is Trace?
    • Configuration options
  • Data Sources
    • External Contexts
Powered by GitBook
On this page
  • Definitions
  • Page template (Parent)
  • Template page (Child)
  • Adding a Page template (Parent)
  • Adding Template pages (Child)
  • Linking to Templated pages
  • Example of list of templated pages by type

Was this helpful?

  1. Site builder
  2. Pages and content

Page templates and Templated pages

How to create reusable Page templates (Parent) which can be used to create many Templated pages (Child) with the same layout and style.

Definitions

Page template (Parent)

This page powers the content, widgets and styles that will be used by all Templated pages (Child). All modules added to the page will be displayed on the Template page (Child) created using this Page template.

These pages are never published on the actual site, and are only used for templating purposes.

Template page (Child)

These are all the individual pages created using the Page template (Parent). These pages do not contain modules or content, and usually only contain the custom fields set on the page as well as the Page path, SEO title tag, etc.

Adding a Page template (Parent)

  • Go to "Page > Add new page"

  • Select "Page template (Parent)" as the Type. You can select a Page name that you will recognize in the future.

  • After the page is created, you will need to go to "Page > Page options" and set a "Template name". Example: some_unique_template_name.

    • Note: This is the alias for the Page template that will be used when adding Templated pages (Child).

Normally all the content within the Page template is static, but for any dynamic content that is typically controlled using custom fields set on each Templated page.

Example of accessing the custom fields for the page that has a Headline, Sub-headline and Page content HTML.

<h1>{{ page.custom_fields.headline }}</h1>
<h2>{{ page.custom_fields.sub_headline }}</h2>
{{ page.custom_fields.page_content|safe }}

Adding Template pages (Child)

  • Go to "Page > Add new page"

  • Select "Templated page (Child)" as the Type

  • This will display a "Custom page type" field. This is where you would enter the "Template name" set on the Page template you created. Example: some_unique_template_name

  • After adding the page, you can control:

    • Page title, name, URL path, etc under "Page > Page options"

    • Control the custom fields for the Page under "Page > Custom fields"

For these pages, you will not see the content within the Site builder, but if you view the page on the Preview URL you should see the Page template (Parent) content, with the dynamic values from the custom fields displayed.

Linking to Templated pages

When using Templated sub pages it is typical to have a page within the site (either the home page or a sub page) that lists and links to all the Templated pages of a certain type.

We have a templating utility to allow to you filter and get a list of these pages.

Example of list of templated pages by type

The below example will grab a list of all the custom pages (of type some_unique_template_name) that are also published, and then order them by the Page name

{% set subpages = pages.filter({'custom_page_type': 'some_unique_template_name', 'active': true}, order_by='name') %}
<ul>
    {% for subpage in subpages %}
        <li><a href="{{ subpage.path }}">{{ subpage.name }}</a></li>
    {% endfor %}
</ul>
PreviousAdding ImagesNextMaps

Last updated 2 years ago

Was this helpful?