CASE: link to a recon template

In a template you make, it could become handy to have a link to another template. This way, an user doesn’t have to click on the working period and search for the desired reconciliation template.

To create in what we call a “linkto-tag”, you need for the template where you want to linkto, a handle :

handle

In custom templates, you can easily add this. For a Silverfin template, a handle should already be existing.
A handle is basically sort of a ‘shortcut’ you can use for a linkto.

To create this:
41

you can use following code:

{% ic %}
  {% if period.reconciliations.vaste_activa != blank %}
    {% linkto period.reconciliations.vaste_activa %}{% t "Click here for fixed assets" %}{% endlinkto %}
  {% else %}
    *{% t "Recon template Fixed Assets is missing from the working papers" %}*
  {% endif %}
{% endic %}

Let’s take a look at the code:

{% ic %}
{% linkto period.reconciliations.vaste_activa %}{% t "Click here for fixed assets" %}{% endlinkto %} 
{% endic %}

So the “link” to a recon template is period.reconciliations.vaste_activa :
period: because it’s period-dependant
reconciliations: in orde to know that a recon template needs to be searched
vaste_activa: this is the handle of the recon template

And we use ic-tag to display this only in input (so it won’t be exported)

{% ic %}
{% linkto url %}content{% endlinkto %} 
{% endic %}

with url = period.reconciliations.vaste_activa
and content whatever you desire, f.i. {% t “Click here for fixed assets” %}

If the recon template doesn’t exist in the working papers however, we’ll see an error like this:
27

That’s why it’s better to add an extra check on this:


{% if period.reconciliations.vaste_activa != blank %}
  {% linkto period.reconciliations.vaste_activa %}{% t "Click here for fixed assets" %}{% endlinkto %}
{% else %}
  *{% t "Recon template Fixed Assets is missing from the working papers" %}*
{% endif %}

This will result in a proper error when the recon template doesn’t exist!

Be sure to add this code between inputcomment :

{% ic %}
nothing will be exported between this
{% endic %}