Skip to content

Feature: Add setting to display course short name in header, resolves #1010 #1011

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: MOODLE_405_STABLE
Choose a base branch
from

Conversation

netanelklein
Copy link

This pull request implements a new theme setting that allows administrators to choose whether course headers display the full course name (default behavior) or the course short name.

Background & Use Case

This feature addresses scenarios where course data comes from external systems that may populate the "short name" field with content that's more appropriate for header display than the full course name. While the field is called "short name," external systems sometimes use it for display-friendly course identifiers that may actually be more suitable for headers than the official full course name.

Changes Made

  1. Theme Setting (settings.php)
    Added new setting useshortnameinheader under the Course tab in theme configuration
    Uses Yes/No dropdown with "No" as default to maintain backward compatibility
    Setting is logically placed in the "Course header" section alongside related course header options
  2. Core Renderer Logic (classes/output/core_renderer.php)
    Modified the full_header() method to check the theme setting
    When enabled and on a course page (excluding site home), the page heading is set to the formatted course short name
    Preserves all existing functionality and header features
    Uses proper context formatting for security and consistency
  3. Language Strings (lang/en/theme_boost_union.php)
    Added useshortnameinheader and useshortnameinheader_desc strings
    Strings follow the theme's existing naming conventions and are descriptive for administrators

@abias abias force-pushed the MOODLE_405_STABLE branch 2 times, most recently from 96feca3 to 7e020da Compare July 19, 2025 08:26
@abias abias force-pushed the MOODLE_405_STABLE branch from 0e0e52a to 70f1a61 Compare July 22, 2025 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants