To Collapse Right-side Blocks 10/31/2018 There are three things to do for this fix: 1) Add CSS to Boost's RAW SCSS dialog box 2) Make changes to moodle/theme/boost/classes/output/core_renderer.php 3) Make changes to moodle/theme/boost/templates/core/block.mustache I prefer to make these changes to my MAMP Moodle, then copy these two files to my ready-to-install Moodle. 1) ----------------------------------------------------------------------- In Boost's Raw SCSS dialog box, add the following code. Note: Once added, you can leave this alone (CSS persists) /* Needed to collapse right-side blocks. Daniel Miericke, modified by Gareth Barnard */ .block { .block-action { @include fa-icon(); cursor: pointer; float: right; margin: .2rem .6rem 0 0; &:before { content: $fa-var-compress; } } &.hidden { .block-action:before { content: $fa-var-expand; } .card-text { display: none; } } } /* Ricks modification */ .card-title { margin-bottom: .0rem; } 2) ----------------------------------------------------------------------- In the file moodle/theme/boost/classes/output/core_renderer.php, replace the existing public function block code with the following code public function block(block_contents $bc, $region) { $bc = clone($bc); // Avoid messing up the object passed in. if (empty($bc->blockinstanceid) || !strip_tags($bc->title)) { $bc->collapsible = block_contents::NOT_HIDEABLE; } else { user_preference_allow_ajax_update('block'.$bc->blockinstanceid.'hidden', PARAM_INT); } $id = !empty($bc->attributes['id']) ? $bc->attributes['id'] : uniqid('block-'); $context = new stdClass(); $context->skipid = $bc->skipid; $context->blockinstanceid = $bc->blockinstanceid; $context->dockable = $bc->dockable; $context->collapsible = $bc->collapsible; $context->id = $id; $context->hidden = $bc->collapsible == block_contents::HIDDEN; $context->skiptitle = strip_tags($bc->title); $context->showskiplink = !empty($context->skiptitle); $context->arialabel = $bc->arialabel; $context->ariarole = !empty($bc->attributes['role']) ? $bc->attributes['role'] : 'complementary'; $context->type = $bc->attributes['data-block']; $context->title = $bc->title; $context->content = $bc->content; $context->annotation = $bc->annotation; $context->footer = $bc->footer; $context->hascontrols = !empty($bc->controls); if ($context->hascontrols) { $context->controls = $this->block_controls($bc->controls, $id); } return $this->render_from_template('core/block', $context); } 3) ----------------------------------------------------------------------- Replace all the contents in the file moodle/theme/boost/templates/core/block.mustache with the following: {{! @template theme_boost/block Example context (json): { "id": "block0", "showskiplink": true, "type": "html", "ariarole": "complementary", "title": "Test block", "blockinstanceid": 1, "content": "
Hello block world!
" } }} {{! Block Skip Link }} {{#showskiplink}} {{#str}}skipa, access, {{title}}{{/str}} {{/showskiplink}} {{#collapsible}} {{#js}} $('#instance-{{blockinstanceid}}-action').click(function() { $('#{{id}} .card-text').slideToggle('slow'); if( $('#{{id}}').hasClass('hidden')) { $('#{{id}}').removeClass('hidden'); M.util.set_user_preference('block{{blockinstanceid}}hidden', 0); } else { $('#{{id}}').addClass('hidden'); M.util.set_user_preference('block{{blockinstanceid}}hidden', 1); } }); {{/js}} {{/collapsible}} {{! Start Block Container }}