CASE: Code parts

Reconciliation templates have a main part and 5 additional parts that can be used for coding.

Including additional parts

The main part is always loaded first and the additional parts can be accessed by using the following code in the main part:

{% include 'parts/name_of_a_part' %}

Variables that have been assigned in the main part will be available in the additional parts and visa versa.

Having ‘global’ parts would be a great addition to this:
code snippets that are configured once on the ‘office level’ and can be reused in all templates.
This would greatly improve the application of the DRY-principle in Silverfin (Don’t Repeat Yourself).
Translations, for example, could be defined once and applied in multiple places, instead of the current way of having to define (and maintain) each translation multiple times, i.e. in each template it is used in.
We have other use cases for these hypothetical ‘global parts’, where we currently have duplicated Liquid-code in multiple templates…
Just a suggestion :slight_smile:

1 Like

Hey @robin.bailleul,

Yes, we know, as it is already listed on our list of feature requests :slightly_smiling_face:

If this would to happen, we will share it definitely here of course! :+1:

Thanks for the suggestion Robin, appreciate it

1 Like

Would be awesome if we had the possiblity to pass parameters to these parts / components as well.

Basic example, this text:

{% ic %}
        {::infotext}
            bla bla something
        {:/infotext}
        br
{% endic %}

Would be replaceable by something like

{% infobox %}bla bla something{% endinfobox %}

or even better:

{%  infobox
   text:'bla bla something'
   color:'blue'
   accountsInScope:some_accounts %}
{%  endinfobox %}

Obviously, examples can be much more complex than this :slight_smile:

Hi Wim,

Unfortunately it will never be possile to adjust tags or make custom tags in liquid. Parts are only used to store a block of code, which you can call upon (as many times as you want) in another part.

You can also find more information about parts on our read me site.

Regards,

Michiel

That’s clear, thanks