Skip to documentation

    Cohort Branding

    Local Plugin
    v1.3.20
    Testing
    Archived compatibility details

    Cohort-based branding for Moodle™. Assign custom colours, fonts, and styling to cohorts - users see their organisation's branding applied site-wide including headings, buttons, and navigation.

    One-time unlock, lifetime updates

    ⭐ Why this plugin is unlike anything else available

    Per-cohort visual identity from a single Moodle instance

    ▸ Serving multiple client organisations with a branded portal traditionally requires a separate Moodle instance per client — separate hosting, maintenance, upgrades, and licences. Cohort Branding delivers a visually distinct portal experience for each client group using their cohort membership as the trigger, from a single shared Moodle instance.

    ▸ Brand elements — logo, header colour, site name, CSS overrides — are stored per cohort and applied at page render time. A learner in the 'Acme Corp' cohort sees the Acme logo; a learner in 'City Council' sees the City Council logo. Both are on the same Moodle site.

    ▸ Survives Moodle upgrades. Branding is applied via plugin hook, not theme file edits. Theme updates do not reset custom branding.

    What is Cohort Branding?

    Cohort Branding applies site-wide styling based on user cohort membership. Configure colours for headings, buttons, and navigation - the styling applies across the entire Moodle™ site for cohort members.

    What It Styles

    • Top header bar colour
    • All headings (H1-H6) - secondary colour
    • Primary and secondary buttons
    • Navbar menu text and hover states
    • CSS variables for consuming plugins

    Key Benefits

    • Branding per cohort
    • Dynamic CSS injection (safe)
    • No theme modifications required
    • Simple admin interface
    Use Cases

    Organisation Branding

    Apply your organisation's brand colours to headings, buttons, and navigation for a consistent look across your Moodle™ site.

    Department Styling

    Different departments or teams can have their own colour schemes applied based on cohort membership.

    Client-Specific Colours

    Training providers can apply client brand colours for learners enrolled in client-specific cohorts.

    Plugin Integration

    CSS variables are exposed for other plugins to consume, enabling consistent branding across your entire plugin ecosystem.

    Key Benefits

    Upgrade Safe

    No theme hacks, survives Moodle™ updates

    Priority System

    Users in multiple cohorts get highest priority branding

    Full Typography

    Comprehensive font styling with icon preservation

    Installation Steps
    1. 1

      Download the plugin

      Get the ZIP file from the download button above

    2. 2

      Install via Moodle™

      Site administration → Plugins → Install plugins → Upload ZIP

    3. 3

      Complete database upgrade

      The plugin creates its database table automatically

    4. 4

      Create cohorts

      Ensure you have cohorts set up (Site administration → Users → Cohorts)

    5. 5

      Configure branding

      Site administration → Appearance → Cohort Branding

    Requirements
    • See archived release notes for supported Moodle environments
    • See archived release notes for PHP requirements
    • At least one cohort created in Moodle™
    • Manager or admin capability
    Branding Options

    Primary Colour

    Styles primary buttons and navbar menu text

    Secondary Colour

    Styles all headings (H1-H6), secondary buttons, and navbar hover states

    Top Header Colour

    Sets the background colour of the top header bar

    Font Family

    Choose from 10 Google Fonts (Inter, Roboto, Poppins, etc.)

    Priority

    Higher priority wins when user is in multiple cohorts

    CSS Variables

    Exposes --cohort-primary, --cohort-secondary, --cohort-header for other plugins

    Technical Features
    • Dynamic CSS injection (no theme modification)
    • Comprehensive font styling with !important overrides
    • FontAwesome icon preservation (no broken icons)
    • CSS caching with 5-minute TTL
    • Colour picker with hex input sync
    • Enable/disable toggle per branding
    • Stores cohort/branding configuration and uses cohort membership to select styling
    Adding Cohort Branding

    Access settings at: Site administration → Appearance → Cohort Branding

    1. Click "Add branding"

    Only cohorts without existing branding will appear in the dropdown.

    2. Select the cohort

    Choose which cohort this branding applies to.

    3. Configure branding

    Set logo URL, colours (with colour picker), and choose a font.

    4. Set priority

    Higher numbers win if a user belongs to multiple branded cohorts.

    5. Save changes

    Branding applies immediately to logged-in cohort members.

    How It Works
    1. User logs in→ Plugin checks their cohort memberships
    2. Highest priority branding found→ If user is in multiple cohorts
    3. Dynamic CSS loaded→ Custom styles injected into page
    4. Branding applied→ User sees their organisation's look
    Frequently Asked Questions

    Does this work with my custom theme?

    Yes! Cohort Branding uses high-priority CSS selectors and !important rules to ensure branding applies regardless of your underlying theme.

    Will this slow down my site?

    No. Branding is applied through a page-output hook, and the user's cohort-membership lookup is served from Moodle's application cache (configured with a 5-minute TTL) rather than hitting the database on every request, making it extremely lightweight.

    What happens if a user is in multiple branded cohorts?

    The branding with the highest priority number will be applied. If priorities are equal, the most recently created branding takes precedence.