Nasir Uddin January 30, 2015 No Comments

How to render moodle frontpage list of courses in theme

Sometimes, we have to render enroleuser lists, course list, news lists in templates of moodle theme. Now, i show you how to render/print moodle frontpage list of courses in theme. [sourcecode language=”bash”] GLOBAL $PAGE; $courserenderer = $PAGE->get_renderer(‘core’, ‘course’); $availablecourseshtml = $courserenderer->frontpage_available_courses(); if (!empty($availablecourseshtml)) { echo html_writer::tag(‘a’, get_string(‘skipa’, ‘access’, core_text::strtolower(get_string(‘availablecourses’))), array(‘href’=>’#skipavailablecourses’, ‘class’=>’skip-block’)); //wrap frontpage course list […]