diff --git a/lib/classes/output/core_renderer.php b/lib/classes/output/core_renderer.php index d79206d016d..fe8b75a9cf2 100644 --- a/lib/classes/output/core_renderer.php +++ b/lib/classes/output/core_renderer.php @@ -1508,7 +1508,8 @@ class core_renderer extends renderer_base { $context->ariarole = !empty($bc->attributes['role']) ? $bc->attributes['role'] : ''; $context->class = $bc->attributes['class']; $context->type = $bc->attributes['data-block']; - $context->title = $bc->title; + $context->title = (string) $bc->title; + $context->showtitle = $context->title !== ''; $context->content = $bc->content; $context->annotation = $bc->annotation; $context->footer = $bc->footer; diff --git a/lib/templates/block.mustache b/lib/templates/block.mustache index 2c3fccc0a50..a9edb7119a7 100644 --- a/lib/templates/block.mustache +++ b/lib/templates/block.mustache @@ -1,3 +1,16 @@ +{{! + This file is part of Moodle - http://moodle.org/ + Moodle is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + Moodle is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with Moodle. If not, see . +}} {{! @template core/block @@ -8,6 +21,7 @@ "showskiplink": true, "type": "html", "ariarole": "", + "showtitle": true, "title": "Test block", "blockinstanceid": 1, "content": "

Hello block world!

" @@ -29,18 +43,18 @@ aria-label="{{arialabel}}" {{/arialabel}} {{^arialabel}} - {{#title}} + {{#showtitle}} aria-labelledby="instance-{{blockinstanceid}}-header" - {{/title}} + {{/showtitle}} {{/arialabel}}> {{! Block contents }}
{{! Block header }} - {{#title}} + {{#showtitle}}

{{{title}}}

- {{/title}} + {{/showtitle}} {{#hascontrols}}