Portal Maintainers Guide¶
As a Portal Maintainer (or Site Administrator), your role is to configure the CKAN portal, integrate chosen extensions, and manage branding customizations. This guide focuses on configuring themes, safely applying local customizations, and maintaining portals across upgrades.
Core Maintenance Goals¶
Branding & Theme Swappability: Configure the site's layout and color palettes to match organization guidelines. Maintain the ability to swap themes without breaking site features.
Upgrade Stability: Avoid customizations that lead to "upgrade lock" (where upgrading CKAN or extensions breaks your custom templates).
Consistent User Experience: Ensure that components from different third-party extensions share a cohesive visual styling.
Theme Configuration¶
The active theme is controlled by the ckan.ui.theme setting in your CKAN configuration file (.ini):
You can discover all registered themes on your system and their inheritance lineages using the CKAN CLI:
Applying Custom Styling Safely¶
If you need to make cosmetic adjustments (like altering colors, font sizes, or paddings) to match local branding, follow these best practices:
1. Prefer _extra_class Over Custom CSS Wrappers¶
When calling standard macros, pass custom class names via the _extra_class argument. This appends your class to the theme's native layout container safely:
2. Declare Custom Styles in Local Stylesheets¶
Avoid editing core theme stylesheets or the component library files. Put custom CSS rules into your own extension's asset files, using the custom classes declared in _extra_class.
Overriding Components Locally¶
If a third-party extension registers a custom component (e.g. map_viewer) but the active theme does not style it properly, you can override its styling locally.
Step-by-Step Component Override¶
- Create a custom extension (or use your portal's local customization extension).
- Register an additional theme UI source in your plugin class:
- Inside
local_overrides.html, define the matching macro name: This will take precedence over the fallback component provided by the extension, allowing you to control its styling completely.