When a custom CKAN theme is the right branding approach
A portal team that needs its own look and home page on CKAN should build a theme extension, and should do it early. A theme extension is a CKAN plugin that layers your templates, styles and assets over the core ones, so the portal's branding lives in its own codebase instead of inside the CKAN installation. Light CSS changes can cover colors, fonts and a logo, but they cannot change page structure, the header and footer, or the layout of the home page and dataset pages. When the branding request goes past the stylesheet, the team needs template overrides, and those belong in an extension that can be versioned, tested and deployed alongside the rest of the portal.
Before committing to a custom theme, list every change the portal owner has asked for and sort it into three groups: cosmetic changes that a stylesheet can handle, structural changes that require altering rendered HTML, and behavior changes that belong in a separate extension rather than a theme. Most portals end up with a small number of structural changes, and the cost of the theme depends on how many of those there are and how far they reach into core pages. Confirm with the portal owner which pages must change and which can stay close to the default. Keep in mind that a theme is only one part of the work: the search index, the Data API and the metadata schema are not affected by branding, so they should not be bundled into the theme scope.
CKAN is licensed under the GNU Affero General Public License v3.0, which governs how you distribute and modify the code, including a theme that changes CKAN's rendered pages. Your legal or procurement team should review that obligation before the work starts, especially if the portal is operated by a public body or a vendor. Public portals such as catalog.data.gov run on CKAN, so the approach is established, but each portal's branding decisions are its own. Ask whichever partner or internal team you choose to show a list of the templates the theme will override, and confirm that list against the CKAN version you plan to run.
Which override method fits each branding change
This table compares the four ways a CKAN theme can change the portal: full template overrides, block-level overrides, snippet replacement, and CSS or JavaScript assets. Read each row as a branding change, then check which method fits it and what that choice will cost the next time CKAN is upgraded. The main takeaway is that the smaller the override, the less work each upgrade creates.
| Method | What it changes and when it fits | Cost at upgrade time |
|---|---|---|
| Colors, fonts and spacing | Visual identity through the theme's stylesheet. Fits almost every portal and should be the first step before touching any template. | Low. Stylesheet rules can conflict with new core markup, so review them after each release. |
| Logo, favicon and site title | Configuration settings and a small number of image files. Fits most branding requests without any template work. | Very low. Usually survives upgrades unchanged, but confirm the setting names for your CKAN version. |
| Block-level overrides | Replaces one named block inside a core template, such as the header or footer, while keeping the rest of the page. Fits changes to a single region of a page. | Moderate. Blocks are only safe while their names and parent templates stay stable, so test them against each release. |
| Snippet replacement | Swaps a reusable fragment, such as a dataset card or navigation item, wherever it appears. Fits repeated elements that need a new structure. | Moderate to high. Every page using the snippet inherits the copy, so changes in core snippets must be merged by hand. |
| Full template override | Replaces an entire core template through ckan_extends. Fits only when the page layout itself must change, such as a custom home page. | High. The copied template no longer receives core fixes, so it must be compared with the new core file on every upgrade. |
| JavaScript assets | Adds behavior such as custom widgets or tracking. Fits interactive features that CSS cannot provide. | Moderate. Scripts can clash with core or other extensions, so keep them small and isolated. |
How theme templates, plugins and core CKAN fit together
A browser request reaches CKAN core, which renders the page from its own templates unless the theme's plugin registers a template directory that comes first in the search path. The theme's templates folder overrides only the blocks and snippets it names, while everything else still comes from core. Check the override list after each core upgrade, because a changed core block or snippet is what makes an override break.
Theme overrides win over core templates, and core changes reach overrides on upgrade.
How ckan_extends and blocks keep overrides small
A theme template should extend the core template and override only the named blocks or snippets it needs to change. In CKAN, the theme's template file declares its parent with {% ckan_extends %}, and each override is a {% block %} with the same name as the block in the core template. Everything else in the core page, including navigation logic, dataset listing markup and form handling, is inherited unchanged. A branding change to the header, for example, usually touches one block and a few lines of CSS, while the dataset page keeps working as CKAN ships it. Before writing any override, check the core template for the block name and the snippet it includes, since those names are the contract your theme depends on.
Copying a whole core template into the theme is the largest upgrade burden you can take on. A full copy freezes every line of the core markup at the version you copied it from, so each CKAN release that changes the page leaves your copy behind, and the changes must be found and merged by hand. When upgrading, check each override against the release notes and the core template at the target version. Pay particular attention to block names that were renamed, removed or moved into a different parent template, because a block that no longer exists is silently ignored and your branding change simply stops appearing. Keep a short list of every block and snippet your theme overrides so that this check takes minutes rather than a full review of the theme.
Test the theme against the exact CKAN release the portal runs, not only the newest one. Build a staging instance on the same minor version, load the home page, a dataset page, an organization page and the account pages, and confirm that each overridden block still renders. Confirm the version with your team before you start, because the release you run determines which block names are valid. If you plan a CKAN upgrade, repeat the same checks on the target release in staging before production. Record the results so that the next upgrade starts from a known list of overrides rather than from memory.
How to build the theme extension step by step
This sequence takes a CKAN portal from a bare theme extension to a branded home page that loads cleanly in your environment. Each step ends with a check, so you know the extension is working before you add the next layer of overrides.
Create the extension package
Scaffold a new extension package with a name that follows your organization's naming convention, typically prefixed with ckanext, and install it into the same Python environment as your CKAN instance. Create the package metadata and an entry point for the plugin class, keeping the theme in its own repository so it can be versioned and deployed separately from core. Done means the package installs in editable or development mode without errors and appears in the installed package list for the CKAN virtual environment.
Register the plugin in the portal configuration
Add the plugin name to the
ckan.pluginssetting in the CKAN configuration file for the environment, and make sure the theme plugin is listed in the order your other extensions expect. Use a theme plugin that implements the template interface and declares its template directory. Done means the configuration file parses without errors and CKAN starts without a plugin loading error in the log.Add the templates directory and first override
Create a templates directory inside the extension package, then add a copy of the home page template that only overrides the blocks you need to change, extending the core template with
{% ckan_extends %}. Keep the first override small, for example a single block such as the site title or intro text, so later changes are easy to trace during upgrades. Done means the override file sits at the path CKAN expects for the home page template and is referenced by the plugin.Add branding assets
Place logos, favicons and the stylesheet or script files in the extension's public and assets directories, and reference them from the template blocks and the asset bundle definition. Confirm the asset bundle is declared in the plugin's update config method so CKAN includes it in the page. Coordinate the asset approach with the Webassets guidance for your CKAN version, since development and production behavior differ. Done means the logo and colors appear on a page served by CKAN without console errors about missing files.
Restart the services and clear caches
Restart the CKAN web process and any background workers that load the same configuration, and clear the browser and any reverse proxy cache so you see current assets. Use the service manager you run in production, such as a systemd unit or container restart. Done means the web process starts cleanly, the log shows the theme plugin loaded, and a hard refresh shows the new assets.
Verify the home page and a dataset page
Open the home page and at least one dataset page, a group page and an organization page in a browser, and confirm the override renders where you intended and the rest of the layout is unchanged. Check the page source for the expected asset references and inspect the browser console for errors. Record the result in your change log so the next override can be verified against the same checklist. Done means both page types render the branding and the core layout still works.
Keep the override set small
Review every template file you added and remove any block that duplicates core markup without a change in it. Write down which core template each override extends and which CKAN version it was written against, so an upgrade reviewer knows what to retest. Ask your CKAN implementation partner or internal owner to confirm the upgrade checklist before the next minor release. Done means each override has a documented purpose and a clear owner.
Which pages to override first in a CKAN theme
The home page is usually the first place a visitor sees the portal's identity, so it carries the largest share of visible branding: the hero area, the logo and site title, the introductory text, the featured datasets and organizations, and the calls to action that send people to search or publishing. In CKAN these elements are reached through the page template and the snippets it includes, so the work is mostly about replacing or extending a few blocks rather than rewriting the whole layout.
- Hero and introduction: Replace the intro block with your portal's message and keep the markup close to core so later upgrades only touch one place.
- Featured content: Decide whether featured datasets, groups or showcases come from configuration or from a snippet you control, and document the choice.
- Header and logo: Brand the header through a small override of the header snippet, with the logo file and site title set in configuration.
- Calls to action: Link to search, publishing and help pages from the home template so visitors do not depend on the navigation menu alone.
- Ordering of sections: Reorder content with block overrides instead of copying the full template.
After changes, check the home page as an anonymous visitor and as a logged-in editor, and confirm the search box and featured items still work.
Dataset pages are where most users land from search engines and links, and they carry the metadata layout, resource lists, sidebars and the dataset action buttons. Branding here is usually limited to colors, typography, the page header and the sidebar, but the page is also where schema-driven fields and resource views appear, so overrides can interfere with features that have nothing to do with the theme. Treat the dataset template as a shared surface and keep changes narrow.
- Dataset header and sidebar: Adjust the layout of the title block and sidebar snippets, but leave the metadata fields that other extensions read untouched.
- Resource list: Style resource items through the stylesheet first and override the resource snippet only when a layout change cannot be done in CSS.
- Dataset actions: Keep edit, follow and download controls in place for users with the right permissions, and check that they hide for anonymous users.
- Custom metadata fields: Confirm that fields from metadata schema extensions still render after any template change.
- Search results: Dataset cards in search results reuse snippets from the dataset list, so test those cards with several datasets, including ones with long titles, missing descriptions and many resources.
Test dataset pages for public, private and draft datasets, and for logged-out, member and sysadmin views, because access rules change what appears.
Organization and group pages are the portal's publisher and theme entry points, so they often need the most visual variation: an organization may have its own logo, description and accent color, and groups may group datasets by topic. These pages reuse many of the same snippets as dataset listings, so a change for one page family can affect the other. Decide early which parts of these pages are portal-wide and which can be customized per publisher.
- Organization header: Show the logo, description and key counts through the header snippet, with defaults for organizations that have not uploaded an image.
- Image fallbacks: Handle missing logos and long names gracefully so layouts do not break for small publishers.
- Group listings: Check how group pages list datasets, including the facets and sorting controls they share with search.
- Membership and admin controls: Keep management links visible only to users with the right role, and verify they do not appear on public pages.
- Per-publisher styling: Use CSS classes tied to the organization or group rather than separate templates, so the number of overrides stays flat as publishers are added.
Test each page with an organization that has many datasets, one with none, and one with a missing logo, both logged out and as a member, and confirm that search results and facets still behave.
Keeping a custom CKAN theme manageable through upgrades
A CKAN theme stays manageable only if you plan around the release policy. The CKAN team supports the latest patch of the current minor version and the previous minor version for security and bug fixes, and an outdated patch loses support once a newer patch is out. Patch releases do not break backwards compatibility and exclude schema changes and new features, while minor releases may include backwards-incompatible changes. In practice, this means a theme that overrides templates can usually take a patch release without edits, but a minor release is where template blocks, snippets and helper usage can change under your overrides. Confirm the current release status and the release notes for your version on the CKAN releases page before you schedule any change.
Retest the theme on every patch release, even when you expect no changes. Keep a short checklist that covers the home page, a dataset page, a resource page, the organization and group listings, the user dashboard and the login and registration pages, since these are the screens your overrides most often touch. Compare the rendered output and the browser console against a known-good baseline, and check that the theme's ckan_extends plugin still loads and that the asset bundles still build. Keep the theme's override list in version control so you can see at a glance which core templates you have copied and which snippets you include, because that list is what you review when a minor release arrives.
Before you move to a new minor release, schedule a theme review as a separate work item rather than folding it into the core upgrade. Start by diffing each overridden template against the same file in the target release, then decide whether each override should be removed, reduced to a small block change or rewritten. Test the theme on a staging copy of the portal with real content volumes, and confirm that any extensions your theme depends on support the target release. Ask your upgrade partner or internal team to estimate the review effort from the size of your override list, since that list is the main driver of cost. Overrides that are small and well documented usually make this review shorter and cheaper.
Security and operational risks in theme code
Theme code runs in every visitor's browser and often ships with production access that few people review. The cards below cover the risks that repeatedly show up in custom CKAN templates and assets, each paired with the control that keeps it contained. Check them before the theme goes live, not after.
Unsafe HTML and script injection
Custom templates and content pages that render user-entered or editor-supplied HTML can run scripts in other visitors' browsers. Anywhere a template outputs a dataset title, description, organization field or extra value with the safe filter turned off, the output is a cross-site scripting path. The control is to escape all dynamic values by default, limit who can enter raw HTML, and test with script payloads in dataset fields before release.
Secrets and internal URLs in assets
Templates and bundled JavaScript sometimes carry API keys, tracking tokens, internal hostnames or staging addresses. Once a file is served to the public, anyone can read it in the page source. The control is to keep credentials in the site configuration or environment, reference public URLs only, and scan the built assets directory for tokens and internal domains before each release.
Third-party scripts and fonts
Analytics tags, chat widgets, font CDNs and embedded maps loaded from outside the portal send visitor data to other parties and create a supply chain dependency. A compromised external script can alter any page on the portal. The control is to inventory every external origin in the theme, self-host fonts and libraries where practical, and document the business reason for each remaining external request.
Uncontrolled changes in production
Theme edits made directly on a production server, or by someone without review, can break navigation, expose draft content or remove access notices with no record of who changed what. The control is to keep the theme extension in version control, require review of template and CSS changes, and deploy only from tagged builds with a named approver.
Access to theme and server settings
The people who can change templates, configuration and static files usually have effective control over what every visitor sees, including login and data access pages. Shared server accounts and broad sysadmin rights make that control hard to audit. The control is to limit server access to named administrators, use separate deployment credentials, and review who holds sysadmin rights on the portal after each change window.
Testing theme changes on staging
A theme that looks correct on a developer laptop can fail with real datasets, large organization lists, private records or the production search index. Layout breaks and broken links often surface only under real content volume. The control is to run every theme release on a staging portal that mirrors production configuration and sample data, and to check logged-out, editor and sysadmin views before promotion.
Questions buyers ask before building a custom CKAN theme
What drives the cost of a custom CKAN theme?
The main cost driver is how much of CKAN's default interface you change. A theme that restyles colors, fonts and the logo is a small job, while a theme that overrides many templates, rebuilds the dataset and organization pages, and adapts layouts for several screen sizes takes much more design and testing time. The number of languages matters too, because every translated template string and every localized page needs review. Ask for the written scope to list the templates to be overridden, the pages to be covered, the languages to be supported and the browsers and devices to be tested. Those items, not a headline price, are what a quote should be built from.
How long does a custom CKAN theme take to build?
Duration depends on the same factors as cost: how many templates and pages change, how much new design work is needed, how many languages must be supported and how many environments the theme must pass through before launch. A portal that only needs branding on a few pages can move much faster than one that rebuilds its whole public interface. Ask for a timeline that is tied to named deliverables, such as the home page, dataset pages and the review cycle with your design and communications teams, rather than a single overall estimate.
What does the portal team need to provide for a theme project?
The portal team needs to supply brand assets, such as logos, color guidance and approved typography, plus written decisions on navigation, page content and accessibility requirements. Someone must own sign-off on the design, and an engineer must provide a development environment that matches production as closely as possible. Access to the server or container images, the CKAN configuration and the existing extensions is also required so the theme can be checked against what is actually deployed. Without these inputs, reviews tend to stall and the scope grows during the project.
Can our internal team build a CKAN theme without a partner?
Yes, if the team has front-end skills, Python experience with CKAN's extension model and the time to maintain the result. The work is well suited to an internal team that already operates the portal and can follow the CKAN extension documentation. The harder part is ongoing maintenance: each CKAN release can change templates, and an internal team must allocate time for those checks. A partner can help when the team lacks capacity, when the design requires specialist work, or when the team wants a written scope, testing and a handover plan before launch.
How do CKAN upgrades affect a custom theme?
A theme overrides CKAN's templates, so every override is a point where a core change can break or contradict the theme. CKAN patch releases are designed not to break backwards compatibility, but minor releases may include backwards-incompatible changes, and the CKAN release policy describes which versions receive support. Plan to review each overridden template against the new CKAN version, retest the home page and dataset pages, and update CSS that depends on core markup. Keeping overrides small reduces the number of places that must be checked at each upgrade.
Why does keeping template overrides small matter?
Each overridden template copies core markup into the theme, so later changes to that core template will not reach the portal automatically. A small set of overrides that uses CKAN's block and snippet structure is easier to review at each upgrade because fewer files must be compared with the new release. Ask engineers to show which templates are overridden, why each one is needed and whether a snippet or block change could achieve the same result instead.
What should we ask for in a written scope for a theme?
Ask for a list of deliverables that names the theme extension, the templates and blocks it overrides, the pages covered and the languages supported. Request the acceptance criteria for each page, the test environments and browsers, the handover documentation and the process for CKAN version changes after launch. Also ask who maintains the theme after go-live, what support or retainer options exist and how change requests are priced. Confirm whether security testing or accessibility review is included, because neither follows automatically from a visual redesign.
Does a custom theme affect security or compliance?
A theme changes what users see, so it can introduce risks such as unsafe inline scripts, exposed internal URLs or accessibility barriers, even though it does not change CKAN's data model. Ask for a review of any custom JavaScript, form handling and third-party assets, and confirm how the theme handles content security policy settings. The theme itself does not establish compliance with an accessibility or privacy standard. Ask your compliance team which requirements apply to your portal and whether a separate review is needed.
What to confirm about your CKAN version and environment
A theme sits on top of the CKAN release, the Python and Solr versions, and every extension already loaded. The items below decide whether an override is safe to write and how much work it will cost to keep it working. Confirm each one in your own environment before you agree on scope.
CKAN release and runtime versions
Record the CKAN minor and patch version, the Python version, and the Solr version in use. Theme templates change between minor releases, so an override written for one release can break on the next. Check the release policy to see which minor and patch releases still receive fixes, and plan your theme around a version you will keep for the life of the project. Ask your team whether the production and staging portals run the same patch level.
Release policyExisting extensions and template overrides
List every extension the portal loads and note which ones ship templates or override the same blocks and snippets as your planned theme. Two extensions that extend the same template file will conflict, and the one loaded later usually wins. Check the plugin order in the configuration file and confirm which extension owns the header, footer and dataset page markup before you write a single override.
Bootstrap version the portal uses
Confirm whether the current theme is built on Bootstrap 3 or Bootstrap 5, and whether any custom CSS depends on Bootstrap class names. Core CKAN moved to Bootstrap 5 in a recent minor release, so older themes often carry Bootstrap 3 markup that will not render correctly. If the portal still uses Bootstrap 3, scope the brand work to include a migration of the templates you override.
Asset hosting and build pipeline
Find out where CSS, JavaScript, fonts and logos are served from, and whether the portal uses a CDN, an internal object store or the web server directly. Confirm how assets are compiled and collected during deployment, and who runs that step in your release process. Assets served from external hosts may conflict with a strict content security policy, so check that policy before adding third-party fonts or scripts.
Development toggle for assets
Check whether the CKAN release you run provides a configuration option that serves assets unbundled for development, and whether your team uses it. Without it, developers must rebuild bundles on every style change, which slows iteration and hides errors until deployment. Confirm the option name and default in the CKAN documentation for your exact version, and agree on whether it may be enabled on any shared environment.
How DeployOpen scopes and delivers a CKAN theme
DeployOpen approaches a custom CKAN theme as a fixed-scope engagement inside your own infrastructure, with the template overrides, assets and handover agreed in writing before build starts. The work is planned so the theme extension stays small, testable and easy to carry across CKAN minor releases.
How we scope
- Written scope lists the pages to brand, such as the home page, dataset pages and header and footer.
- Agreed list of CKAN releases and Python, Solr and PostgreSQL versions the theme must run on.
- Quote follows from the written scope, with the theme deliverables and timeline agreed before work starts.
How we build
- Theme extension built with ckan_extends and template overrides limited to the blocks and snippets that need branding.
- Asset bundling and styling kept separate from core templates so upgrades touch fewer files.
- Testing on a staging portal with your data, covering dataset pages, search results and the home page layout.
How we hand over
- Source repository with the theme extension, install steps and a short list of every overridden template.
- Documented override map showing which core templates changed and why, to guide future upgrade reviews.
- Handover session with your platform team on deploying, updating assets and rolling back the theme.
How we support
- Ongoing support and upgrade testing for the theme can be delivered as a retainer after handover.
- Theme checks against each new CKAN patch and minor release before you adopt it in production.
- Confirm with DeployOpen which support level, response terms and review cadence the retainer includes before signing.

