TIP: use of snippets

When writing down code, it can become apparent to write down mistakes, which causes your template to crash. If you have a lot of code, it can become time consuming to search where the error generated (although our editor gives you the line number where it goes wrong (probably)) :

{% if custom.meerwaarde.soort == 'vrijwillig' %}
Some text
{% endif } 

will generate this error:
52

as you can see by now, your endif-tag was written down wrong (has to be {% endif %} instead of {% endif }!

:mega: :bulb:

But you can avoid such things, by just typing the word of your opening-tag of your code and than immediately do a TAB.
So in our example, just type if and then do TAB. What you’ll see, is that the Silverfin editor automatically creates your code!!

editor

You can use it for other statements as well.

Want unless-statement? Type unless and TAB

:bulb:

You can see an overview of all the posibilities in the editor if you just press ALT + space
editor

So these are all the “words” you can just type and TAB to create your code in a single moment without having the change on making typos

5 Likes

We’ve added 3 new snippets for the group, indent and target tags:

group tab

{::group}
content
{:/group}

more info here

indent tab

{::indent level="level"}
content
{:/indent}

more info in this case

target tab

{::target id="target_id"}label{:/target}

more info in this case

3 Likes