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 […]

Nasir Uddin January 19, 2015 No Comments

How to create a block region in moodle theme

First of all, in your theme config file, please write a name of your custom block region like in below [sourcecode language=”bash”] $THEME->layouts = array( // Most backwards compatible layout without the blocks – this is the layout used by default. ‘base’ => array( ‘file’ => ‘default.php’, ‘regions’ => array(), ), …… …… // The […]