Moodle: v3.3.1
Theme: Mytheme (cloned from Boost for template/layout, but using own styles)
Hi there,
I'm trying to change the way Course listing page is at the moment. It uses Topic format where all topics/modules of a course are listed first as links followed by a new page where each section's individual activities/resources appear.
I'd like to
- Move the "Forums or General" section on the right with other blocks
- Add some of our own CSS classes in the markup to style the Course Listing page as per our theme
The theme config has the below renderer set and I also have a core_renderer in my theme working perfectly fine
$THEME->rendererfactory = 'theme_overridden_renderer_factory';https://moodle.org/mod/forum/discuss.php?d=229890 is somewhat similar to what I'm trying to do but not sure if it's the correct way & what should be the folder/naming convention?
As per the above link, rather than extending `format_section_renderer_base`, it's best to extend `format_topics_renderer` as that's the format being used. So have followed that path but to no success.
This is what I have so far:
theme mytheme classes output core course_format_topics_renderer.php
namespace theme_mytheme\output\core;
defined('MOODLE_INTERNAL') || die();
use moodle_url;
require_once($CFG->dirroot.'/course/format/topics/renderer.php');
class course_format_topics_renderer extends \format_topics_renderer
{
public function print_single_section_page($course, $sections, $mods, $modnames, $modnamesused, $displaysection) { ... existing code borrowed ... custom code }
public function print_multiple_section_page($course, $sections, $mods, $modnames, $modnamesused) {
global $PAGE; ... existing code borrowed ... custom code } }
But this doesn't work as it has no effect whatsoever on the Course listing pages.
I think if I manage to override the below functions in my theme renderer somehow, I can then manipulate the Course Listing page completely.
format_topics_renderer::print_single_section_page format_topics_renderer::print_multiple_section_page
Any thoughts or guidance in this direction will be appreciated?
Thanks in advance!