In Moodle 3.11, we are building a custom theme extending Boost, and our designer asked us if we could add a welcome message in the Dashboard page header (#page-header), something like "Welcome on board!".
So after inspection, here what I found:
- by default in Boost the mydashboard layout hides the page header except for screen reader (with nocontextheader set to true in Boost/config.php)
- the text content of the page header seems to be defined by this line https://github.com/moodle/moodle/blob/MOODLE_311_STABLE/my/index.php#L73
$header = "$SITE->shortname: $strmymoodle";
I could have something like that for example:
$header = "Welcome $USER->firstname";
- I can change the option for mydashboard -> nocontextheader to false in my theme config.php so that the header shows.
- But how can I modify the header text content from my theme without modifying my/index.php ? It is a top-level file and I would like to avoid core patches if possible. Is there any place in my theme where I can easily override the page heading (i.e. with $PAGE->set_heading($header) for example) for a given page?