[LearnR] Site home to display the block drawer by default
by Visvanath Ratnaweera -
Number of replies: 1
In reply to Visvanath Ratnaweera
Re: [LearnR] Site home to display the block drawer by default
by Bob Gilmore -
Hey Visvanath. This problem isn't just a LearnR theme problem, but one for any boost based theme.
There are a couple of fixes that work. My preferred one is to use the Admin > Appearance > Additional HTML > Within Head:
There are a couple of fixes that work. My preferred one is to use the Admin > Appearance > Additional HTML > Within Head:
<script> window.addEventListener('load', () => {
if( window.matchMedia('(min-width: 700px)') ) {
document.querySelector('#page-site-index .drawer-right-toggle button').click();
} });
</script>
This forces the block drawer open on the site index only and only if the page is greater than 700px wide. For every page on the site, remove #page-site-index
from the query selector.
If you feel comfortable building a child theme or even hacking the boost code, this tracker item https://tracker.moodle.org/browse/MDL-75303 has a means of modifying the code to achieve the same result.