Skip to content

Commit

Permalink
MDL-74602 theme_boost: fix missing activity header in embedded layout
Browse files Browse the repository at this point in the history
The activity header, which includes things like dates and completion
information, was moved out of the page $OUTPUT and into a separate
template context variable in 4.0, meaning it was missing from any layout
which didn't actively add it back to the page output. This fixes this
problem for the embedded layout only by adding support for the activity
header in the embedded template.
  • Loading branch information
snake committed May 3, 2022
1 parent 8b359ad commit cc18240
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions theme/boost/layout/embedded.php
Expand Up @@ -26,9 +26,11 @@

$fakeblockshtml = $OUTPUT->blocks('side-pre', array(), 'aside', true);
$hasfakeblocks = strpos($fakeblockshtml, 'data-block="_fake"') !== false;
$renderer = $PAGE->get_renderer('core');

$templatecontext = [
'output' => $OUTPUT,
'headercontent' => $PAGE->activityheader->export_for_template($renderer),
'hasfakeblocks' => $hasfakeblocks,
'fakeblocks' => $fakeblockshtml,
];
Expand Down
3 changes: 3 additions & 0 deletions theme/boost/templates/embedded.mustache
Expand Up @@ -61,6 +61,9 @@
</section>
{{/hasfakeblocks}}
<section class="embedded-main">
{{#headercontent}}
{{> core/activity_header }}
{{/headercontent}}
{{{ output.main_content }}}
</section>
</div>
Expand Down

0 comments on commit cc18240

Please sign in to comment.