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 27, 2015 No Comments

How to synchronize two mysql database schema?

To deploy your database change from local server to live server you can easily use this script. What can do this script? 1. Transfer new table from local database to database of live server. 2. Add new fields in existing table of database. To do this, first install Schema Sync a MySQL Schema Versioning and […]

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

Nasir Uddin January 5, 2015 No Comments

How to optimizing Images using Grunt

As promised at the end of How to concatenate and minify multiple CSS and JS files using Grunt (part 1), now i will show you How to optimizing images with Grunt. So, you have to install grunt plugin imagemin from your terminal. [sourcecode language=”bash”] npm install grunt-contrib-imagemin –save-dev [/sourcecode] Once the plugin has been installed, […]

Nasir Uddin January 4, 2015 2 Comments

How to concatenate and minify multiple CSS and JS files using Grunt

You have probably heard about Grunt. Grunt is a task runner of Node.js. It is similar as Gulp. Already, you have informed npm is the package manager for grunt. So first of all, you have to install npm. I will show you all from obuntu terminal. Open your terminal and install npm using in below […]