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
  • Custom theme
  • Header code
  • CSS
  • Header template
  • Footer template
  • Page blocks
  • Block #1 - Location information
  • Block #2 - Custom field examples

Was this helpful?

  1. Themes and custom templates
  2. Example themes

Location focused page with bootstrap

Example of the simple theme that displays a single page with location data and custom fields

Custom theme

Header code

Adds bootstrap library from a CDN and includes some Google webfonts

<!-- Bootstrap CDN -->
<link href="//stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
<!-- Google Fonts -->
<link href="//fonts.googleapis.com/css?family=Merriweather+Sans:400,700" rel="stylesheet">
<link href='//fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic' rel='stylesheet' type='text/css'>

CSS

Some CSS styles to customize our elements

body,
html {
  width: 100%;
  height: 100%;
}

.btn {
  font-family: "Merriweather Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

#contact {
    padding-top: 100px;
    padding-bottom: 100px;
}

Header template

<div class="navbar navbar-dark bg-dark shadow-sm">
  <div class="container d-flex justify-content-between">
    <a href="#" class="navbar-brand d-flex align-items-center">
      <strong>Example bootstrap theme</strong>
    </a>
  </div>
</div>

Footer template

Simple copyright notice for the bottom of the pages

<footer class="bg-light py-5">
<div class="container">
  <div class="small text-center text-muted">Copyright &copy; 2019 - ${business_name}</div>
</div>
</footer>

Page blocks

These page blocks will be created from a HTML Code module dragged from the module tray into the body of the page. You can stack many of these kind of blocks to construct your page. Note: you will need to activate the "Enable Jinja rendering" option under "Advanced" when you add the module to the page.

Block #1 - Location information

This example shows standard ways of outputting the location data as:

  • Macros - i.e. ${location_name}

  • Template variables - i.e. {{ location.street }}

{$ set location = site.locations[0] %}
<section class="jumbotron text-center">
  <div class="container">
    <h1 class="jumbotron-heading">${location_name}</h1>
    <p class="lead text-muted">
    <p>
      {{ location.street }}{% if location.street2 %}{{ location.street2 }}{% endif %}<br>
      ${city}, ${state} ${postal_code}
    </p>
    <p>
      <strong>{{ now.today().weekday()|day_name }}</strong> ${todays_hours_of_operation}
    </p>
    <p>
      <a href="tel:${phone}">${phone}</a>
    </p>
    <p>
      <a class="btn btn-primary my-2" href="https://www.google.com/maps/search/?api=1&query=${street} ${city} ${state} ${postal_code}">Get directions</a>
      <a class="btn btn-secondary my-2" href="tel:${phone}">Call now</a>
    </p>
  </div>
</section>

Block #2 - Custom field examples

This example shows how to access the custom fields as:

  • Macros - i.e. ${custom_headline}

  • Template variables - i.e. {{ site.custom_fields.description }}

<section class="page-section" id="contact">
  <div class="container">
    <div class="row justify-content-center">
      <div class="col-lg-8 text-center">
        <h2 class="mt-0">${custom_headline}</h2>
        <hr class="divider my-4">
        <p class="text-muted mb-5">{{ site.custom_fields.description }}</p>
      </div>
    </div>
    <div class="row">
      <div class="col-lg-4 ml-auto text-center">
        <i class="fas fa-phone fa-3x mb-3 text-muted"></i>
        <div>${phone}</div>
      </div>
      <div class="col-lg-4 mr-auto text-center">
        <i class="fas fa-envelope fa-3x mb-3 text-muted"></i>
        <a class="d-block" href="mailto:${contact_email}">${contact_email}</a>
      </div>
    </div>
  </div>
</section>
PreviousExample themesNextStore locator theme example

Last updated 5 years ago

Was this helpful?

For more examples of custom fields, view those .

here