Since the template I am using is not free and cannot be included, I choose this one:
which is free, quite complete and it looks good. The paid one is still better, but not that much better, and for the purpose of this project the free template is great!
Both the free template I’m publicly using and the internal one that I’ve bought are based on bootstrap, so they are interchangeable quite easily.
Base.mc is the superclass of most components of the project, the following flag is implicitly set:
and it will provide the standard template for most of the components on the application.
This means that if my
it will be nicely wrapped by the template provided in
Base.mc, with the html, head, body, includes, and everything!
This is my
Base.mc - I’ve just removed something to make this post smaller.
I still have some doubts, here I’m using
_app parameters, but what if some component is POSTing a
title or an
_app value? Anyways:
head_includes.mi component, all code that has to be included in the body section has been moved to
The inner component will be wrapped inside the template.
I had to remove the newline after augment wrap, otherwise it will appear as the first line on the generated HTML page:
The title will be defined in an inner component, so we have to use defer:
I translated some components from HTML to Mason, for example I created a
dropdown_alerts.mc component that calls the internal
Isn’t this nice? Yes! I only converted few components, because I’ll have to use AJAX sooner or later. Now I just wanted to have a template and I can move on working on my project!
Is it better to use dashes instead of underscores on component names? I think… yes, this is the trend! I’ll work on it.