Basic Page Templates and Layouts
Reusable layouts so every page doesn't need reinventing
People expect navigation, content and controls to sit in the same place on every page. Break that expectation and the portal feels amateurish even when everything works.
Templates are how you keep that promise without rebuilding the furniture on each page. They also make the portal cheaper to change later - fix the header once instead of forty times.
Step by step
1. Know what sits inside what
The hierarchy:
Base Template (foundation)
├── Layout Template (structure)
├── Page Template (specific content areas)
└── Content Templates (reusable blocks)
And the pieces every layout needs: a header with logo, navigation and account controls; navigation covering the primary menu, breadcrumbs and utility links; a content area flexible enough for whatever page uses it; a sidebar for secondary navigation and calls to action; and a footer with the legal bits and contact details.
2. Build the base template
In the Portal Management app, under Content → Web Templates, create one called “Base Layout” and put the skeleton below in Source. A web template has no type field. Pages reach it through a Page Template (under Website) with Type set to Web Template and the web template selected - one page template per layout you want to offer in the design studio, each pointing at the template that extends the base.
Then the HTML skeleton everything else inherits:
<!DOCTYPE html>
<html lang="{{ website.selected_language.code }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}{{ snippets['Portal Name'] }}{% endblock %}</title>
<!-- The site's own CSS web files, by partial URL, in the order Manage CSS lists them -->
<link rel="stylesheet" href="/bootstrap.min.css">
<link rel="stylesheet" href="/theme.css">
<link rel="stylesheet" href="/portalbasictheme.css">
<!-- Custom CSS -->
{% block css %}
<link rel="stylesheet" href="/portal-theme.css">
{% endblock %}
</head>
<body class="{% block body_class %}{% endblock %}">
<!-- Skip to main content for accessibility -->
<a class="skip-link" href="#main-content">Skip to main content</a>
{% include 'Header' %}
<main id="main-content" role="main">
{% block breadcrumbs %}
{% include 'Breadcrumbs' %}
{% endblock %}
{% block content %}
<!-- Page content goes here -->
{% endblock %}
</main>
{% include 'Footer' %}
{% block scripts %}
<!-- jQuery, Bootstrap JS and your own scripts, by web file partial URL -->
{% endblock %}
</body>
</html>
Two things about this skeleton. It renders the whole document, so the page template needs Use Website Header and Footer unticked; leave it ticked and your output lands between the site’s own header and footer. And it links the site’s own Bootstrap rather than a CDN copy. Which Bootstrap you have is a site-level decision - 3.3.x by default, 5 for new sites in an environment with the enhanced data model, or after migrating with pac pages bootstrap-migrate - and a CDN link on top of it just gives you two Bootstraps fighting. Page copy is rendered once, in the content block, not in the head.
3. Specialise from there
A list page template, for the data-heavy pages:
{% extends 'Base Layout' %}
{% block title %}{{ page.title | escape }} - {{ snippets['Portal Name'] }}{% endblock %}
{% block body_class %}list-page{% endblock %}
{% block content %}
<div class="container-fluid">
<div class="row">
<!-- Main content area -->
<div class="col-lg-9">
<div class="page-header">
<h1>{{ page.title }}</h1>
{% if page.description %}
<p class="lead">{{ page.description }}</p>
{% endif %}
</div>
<!-- Action buttons -->
<div class="page-actions mb-4">
{% block page_actions %}
<!-- Default actions like "Create New" button -->
{% endblock %}
</div>
<!-- Main content block -->
<div class="list-container">
{% block list_content %}
{{ page.adx_copy | liquid }}
{% endblock %}
</div>
</div>
<!-- Sidebar -->
<div class="col-lg-3">
<div class="sidebar">
{% block sidebar %}
{% include 'List Sidebar' %}
{% endblock %}
</div>
</div>
</div>
</div>
{% endblock %}
Same bones, different content region. That’s the idea - specialise the middle, never the frame.
4. Make it responsive once
Set up the CSS framework at the template level and every page gets it for free:
/* Portal Theme CSS (portal-theme.css) */
/* Custom CSS Variables for Consistent Theming */
:root {
--primary-color: #0066cc;
--secondary-color: #f8f9fa;
--success-color: #28a745;
--warning-color: #ffc107;
--danger-color: #dc3545;
--text-color: #333333;
--border-color: #dee2e6;
--border-radius: 8px;
--box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
/* Layout Components */
.page-header {
border-bottom: 1px solid var(--border-color);
padding-bottom: 1rem;
margin-bottom: 2rem;
}
.sidebar {
background-color: var(--secondary-color);
border-radius: var(--border-radius);
padding: 1.5rem;
height: fit-content;
}
/* Responsive Breakpoints */
@media (max-width: 768px) {
.page-actions {
flex-direction: column;
}
.sidebar {
margin-top: 2rem;
}
}
Wrapping up
Time spent on templates pays back on every page you build afterwards, and on every change you make in two years when you’ve forgotten how any of it works. Design for the user, check it on a phone, and keep it simple enough that the next person can follow it.
Useful links
- Web templates
- Page templates
- Liquid overview
- Liquid template tags: extends, block, include
- Custom page layouts
- Bootstrap version 5 in Power Pages
Next: styling and branding, and making the thing look like it belongs to you.