# Custom text "info blad"

**URL:** <https://community.silverfin.com/t/custom-text-info-blad/2114>\
**Category:** Templates\
**Tags:** admin\_data\
**Created:** [June 18, 2021, 1:46pm UTC](https://community.silverfin.com/t/custom-text-info-blad/2114 "2021-06-18T13:46:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexanderDB](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@AlexanderDB](https://community.silverfin.com/u/AlexanderDB)\
**Post date:** [June 18, 2021, 1:46pm UTC](https://community.silverfin.com/t/custom-text-info-blad/2114/1 "2021-06-18T13:46:34Z")

</div>

Hi,

We are having a problem with a custom text document: “info blad”  
We are trying to give an overview of shareholers and directors but we ar strugling with the kind of shares.  
Code

```auto
**Overzicht van de aandeelhouders**
{% stripnewlines %}
{% newline %}
| **Aandeelhouders**
| **Aantal aandelen**
| **Met stemrecht** {% ic %}{::infotext as="hover"}Deze data wordt opgehaald uit de bedrijfsparameters{:/infotext}{% endic %}
| **Eigendom**
| **Klasse**
| **Stemrechten t.o.v. totaal**
{% newline %}
|---
|---:
|---:
|---:
|---:
|---:{% ic %}#{% endic %}{% nic %}+{% endnic %}{% for shareholder in period.shareholders %}
{% assign words = shareholder.name | split: ' ' %}
  {% assign lastname = "" %}
  {% assign person_first_name = "" %}
  {% assign current_signature = "" %}
  {% for word in words %}
    {% if forloop.last %} {% comment %}correct for syncs like adminis{% endcomment %}
      {% assign person_first_name = word %}
    {% else %}
      {% assign lastname = lastname | append:" " | append:word %}
    {% endif %}
  {% endfor %}
{% if shareholder.custom.represented_by_vat != blank %}
  {% assign default_type ="legal" %}
{% else %}
  {% assign default_type ="nature" %}
{% endif %}
{% comment %}create local var to indicate whether or not a legal person is selected{% endcomment %}
{% assign type_person = shareholder.custom.type | default:default_type %}
{% newline %}
{% if shareholder.custom.first_name == blank and shareholder.custom.last_name == blank %}
      {% assign current_signature = shareholder.name %}
    {% elsif shareholder.custom.first_name == blank and shareholder.custom.last_name != blank %}
      {% assign current_signature = shareholder.name %}
    {% elsif shareholder.custom.first_name != blank and shareholder.custom.last_name == blank %}
      {% assign current_signature = shareholder.name %}
    {% else %}
      {% assign current_signature = current_signature | append:shareholder.custom.first_name | append:" " | append:shareholder.custom.last_name %}
    {% endif %} 
|{{ current_signature }}
|{{ shareholder.amount_of_shares | integer }}
|{{ shareholder.amount_of_votes | integer }}
|{{ shareholder.custom.kind_of_shares }}
|{{ shareholder.custom.shares_classes }}
|{% $2+ shareholder.amount_of_votes/$1 %}{{ shareholder.amount_of_votes/$1 | percentage }}
{% endfor %}
{% newline %}
| **Totaal aantal aandelen**
| **{{ $0 | integer }}**
| **{{ $1 | integer }}**
|
|
| **{{ $2 | percentage }}**
{% endstripnewlines %}

```

output

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/2X/0/0f1d9f135550d04ba95fd7291ad2deffe0998e69.png)

the value in `|{{ shareholder.custom.kind_of_shares }}` doesn’t contain any value

however if we overwrite the dropdown in “bedrijfsparameters”  
 ![image](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/2X/1/1f402e7d3774b7159b612d09b797bcd22649c0f2.png)  
then `|{{ shareholder.custom.kind_of_shares }}` has a value.

At first, it seemed like a caching issue. We got this anwer via support:

_The issue here is that the custom template is not supporting the default value coming from the sync for the ‘Eigendom’ field._

_The custom template only displays person.custom.kind\_of\_shares, but the company parameters also check if there’s a stock type available from the sync in person.custom.stock\_type._

_See below for the code snippet we use to map the sync value to this dropdown in the ‘Bedrijfsparameters’:_  
`| **{% t "Aard aandelen" %}** {% assign stock_type_from_sync = person.custom.stock_type %} {% assign def_stock_type = "" %} {% case stock_type_from_sync %} {% when 1 %} {% assign def_stock_type = "Volle eigendom" %} {% when 2 %} {% assign def_stock_type = "Naakte eigendom" %} {% when 3 %} {% assign def_stock_type = "Vruchtgebruik" %} {% when 4 %} {% assign def_stock_type = "Onverdeeldheid" %} {% endcase %} | {% input person.custom.kind_of_shares as:select default:def_stock_type options:"Volle eigendom|Naakte eigendom|Vruchtgebruik|Onverdeeldheid" %}`

but I don’t really know how to implement this in our custom text. maybe because it’s fridayafternoon, i don’t know 🙂

Can anyone help me with this?  
Thanks!

---

<div class="post-metadata">

**Author:** ![Kimberly\_Vlietinck](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/kimberly_vlietinck/32/1496_2.png) [@Kimberly\_Vlietinck](https://community.silverfin.com/u/Kimberly_Vlietinck)\
**Post date:** [June 21, 2021, 9:22am UTC](https://community.silverfin.com/t/custom-text-info-blad/2114/2 "2021-06-21T09:22:47Z")

</div>

Hi @AlexanderDB,

Instead of just printing `{{ shareholder.custom.kind_of_shares }}` you will also have to take into account the default value `def_stock_type` that contains the value from the sync and is added to that input field in the company parameters.

Here’s a step by step of how you can implement that in your code.

You will first want to assign the default value which contains the sync value:

```auto
{% assign stock_type_from_sync = shareholder.custom.stock_type %} 
{% assign def_stock_type = "" %} 
{% case stock_type_from_sync %} 
{% when 1 %} {% assign def_stock_type = "Volle eigendom" %} 
{% when 2 %} {% assign def_stock_type = "Naakte eigendom" %} 
{% when 3 %} {% assign def_stock_type = "Vruchtgebruik" %} 
{% when 4 %} {% assign def_stock_type = "Onverdeeldheid" %} 
{% endcase %}

```

Then you can create a local variable, I called it `kind_of_shares` here that not only looks at the input field but also takes into account the default value from the sync.

```auto
{% assign kind_of_shares = shareholder.custom.kind_of_shares | default:def_stock_type %}

```

And then you can print this:

```auto
|{{ kind_of_shares }}

```

Hope this clarifies it for you.

Kind regards,  
Kimberly

---

<div class="post-metadata">

**Author:** ![AlexanderDB](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@AlexanderDB](https://community.silverfin.com/u/AlexanderDB)\
**Post date:** [June 22, 2021, 11:20am UTC](https://community.silverfin.com/t/custom-text-info-blad/2114/3 "2021-06-22T11:20:36Z")

</div>

Hi @Kimberly_Vlietinck ,

thanks! This works fine.  
first we thought it was some kind of caching issue.
