[LearnR] Site home to display the block drawer by default
Re: [LearnR] Site home to display the block drawer by default
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.
Re: [LearnR] Site home to display the block drawer by default
Thank you Bob for this contribution. I remove, as you suggested, the #page-site-index to show the block on every pages.
The consequence is that when the user logs in, the block drawer effectivly shows but when he goes to an other page, the drawer closes.
The code is doing a toggle between the states open and close.
How to modify this code to keep th drawer open ?
Thanks
Yvan