There are a couple of things you could do on the PHP side.
- Override the course format in your own theme. If you're overriding the weeks format, for example,
- add a file to your theme at: /theme/mytheme/classes/format_weeks_renderer.php
- Add the class theme_mytheme_format_weeks_renderer extends format_weeks_renderer
- Add the function protected function section_summary
- Add you code in there (see attachment)
- Override the core renderer - see https://docs.moodle.org/dev/Overriding_a_renderer
- If you look at columns2.mustache, you will see a bunch of {{{ output.nameofsomefunction }}} e.g. output.full_header, output.course_content_header
- Each of those you can override in your core renderer.
- You can also add your own functions to your overridden core renderer, just by creating the function, and adding the appropriate output tag.
- {{{output.whateveryouwant}}}
- function whateveryouwant()