hello, i’m new to code and i’m having a little trouble with alignments. See the code below, I would like to see classify 3 checks next to each other. Is it possible that when we select a check a predefined paragraph is added in the text?
To show text based on the condition that the checkbox is ticked, you could use an IF-statement, for instance:
{% if custom.test1.advance == true %}Your text{% endif %}
To structure your content, you have to change the table definition (dashes and pipes under the stripnewlines tag). This is where we indicate the amount of columns our table needs to have. Below I added a simple variation of your code to illustrate how this works:
Many thanks for your response, that’s exactly what I wanted. I added another piece of code to make the text editable, what do you think? is it correct?
I also made a list that I want to make editable like the code above but if one of the points is not needed I can remove it and the numbering of my list is correct. Is it possible ?
In order for us to advise, you’ll have to be a bit more specific as to what your actual issue is.
What is the output that you want? What is wrong with the export you’re referring to?
Sidenote: please share your code wrapped in ``` for optimal readability (you’re using ‘’’ which doesn’t work).
I want to be able to choose the directors, I use {{ period.directors. }} but when the director is a legal entity I would like to have the name of the representative . Is this possible?
What I would like to have is a choice between the different directors and when they are legal entities that the name of the representative appears instead of the name of the company.
I would also like to have the function in the company that is listed in the company details.
you want to choose between the different directors, therefor look into the database = period.directors
Further, you want that the legal entities show ‘represented by’ after the entities name, therefor you distinguish between the type - legal or nature . Only legal entities have a person.custom.represented_by_name != blank
When the type is legal => you show the person.name , represented by ,person.custom.represented_by_name and store it into names
To make every option of the dropdown unique, store the person.id into values
Now, you have created the dropdown to choose between directors : {% input custom.choosing.directors as:select options:names option_values:values %}
You can apply the same logic to show the function in person.custom.function, however here you should be aware that the function is stored as a number as follow :
{% case person.custom.function %}
{% when 10 %}{% assign person_function = "Voorzitter van de Raad van Bestuur" %}
{% when 11 %}{% assign person_function = "Ondervoorzitter van de Raad van Bestuur" %}
{% when 13 %}{% assign person_function = "Bestuurder" %}
{% when 14 %}{% assign person_function = "Gedelegeerd bestuurder" %}
{% when 20 %}{% assign person_function = "Bestuurder-zaakvoerder" %}
{% when 30 %}{% assign person_function = "Zaakvoerder" %}
{% when 40 %}{% assign person_function = "Vennoot" %}
{% when 60 %}{% assign person_function = "Voorzitter van de Raad van Commissarissen" %}
{% when 61 %}{% assign person_function = "Commissaris" %}
{% when 63 %}{% assign person_function = "Regeringscommissaris" %}
{% when 70 %}{% assign person_function = "Externe accountant" %}
{% when 71 %}{% assign person_function = "Bedrijfsrevisor" %}
{% when 80 %}{% assign person_function = "Vereffenaar" %}
{% when 81 %}{% assign person_function = "Curator" %}
{% when 72 %}{% assign person_function = "Erkende boekhouder" %}
{% when 73 %}{% assign person_function = "Erkende boekhouder-fiscalist" %}
{% endcase %}
This works perfectly, however when I take “custom.choosing.directors” and add it at different places in my text to avoid having to choose each time, I don’t get the name but a number.
When you print custom.choosing.directors in any place in your code, this will show the selected option value instead of the selected option indeed. If you want to make the option (i.e. names in this case) visible you should to the following:
{% assign names = names | split:‘|’ %}
{% for person in directors %}
{% assign forloop_index = forloop.index0 %}
{% if person.id == custom.choosing.directors %}{{ names[forloop_index] }}{% endif %}
{% endfor %}
You need to loop through the period.directors again and identify which one you have selected in the dropdown. This exact one will be in the same position in the names array.