Add block parameters to custom html block

519 Views Asked by At

So in mobirise 4.0.15 I have noticed that supplied template blocks have "block parameters" enabled, but custom html blocks do not.

Looking at the source, I can see that the parameter properties which flow into sass are defined within <mbr-parameters>.

However copy and pasting <mbr-parameters> into a custom html block does not enable "block parameters" for some reason.

So how can I enable block parameters for a custom html block?

1

There are 1 best solutions below

0
On BEST ANSWER

I've noticed that if add one of the supplied templates, then replace everything with my own custom html, the block parameters remain enabled which then allow me to write my own custom block parameters which is pretty cool.

I have contacted the devs asking if whether there is a better approach than this workaround, but at least this will achieve the desired results in the meantime (I will update this post once I have a reply).

An example:

<mbr-parameters>
<!-- Block parameters controls (Blue "Gear" panel) -->
    <input inline type="range" title="Margin Top" name="marginTop" min="0" max="8" step="1" value="6">
    <input inline type="range" title="Margin Bottom" name="marginBottom" min="0" max="8" step="1" value="6">
<!-- End block parameters -->
</mbr-parameters>

And then in my css:

margin-top: (@marginTop* 15px);
margin-bottom: (@marginBottom* 15px);