Master
Structure
master.html.liquid
Template Considerations
The master template is a bit different from all the other templates that are at your disposal. It's a template that is rendered for all customizable pages. It gives you full control over the structure of your learning experience. In the default implementation it includes just a single Liquid tag:
{% body %}
The body
tag renders the content of a specific page based on the current URL. This means you can put there any HTML you want and it will be rendered on every page your learner is accessing. For example, you can add a banner on the top of every page:
<div class="my-banner">
Welcome to my school!
</div>
{% body %}
Or wrap the content of the page in a container:
<div class="my-container">
{% body %}
</div>
Or include a JS snippet that will run everywhere:
{% body %}
<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXX-Y', 'auto');
ga('send', 'pageview');
</script>
<!-- End Google Analytics -->
This gives a lot of flexibility to implement the most sophisticated school designs.
Updated about 2 months ago