Is there a way to design an invoice in such a way that the first custom field displays the title and the second custom field does not?
Currently, the custom field code for official themes is:
{% for field in custom_fields %}
<tr>
<td colspan="99">
<div style="font-weight: bold; padding-top: 20px">{{ field.label }}</div>
<div>{{ field.text | newline_to_br }}</div>
</td>
</tr>
{% endfor %}
But, it applies this same pattern to all custom fields which have been defined for customers.
Is it possible to use custom field position identifiers to apply different designs to each one? e.g.
{% for field in custom_fields at position 1 %}
<tr>
<td colspan="99">
<div style="font-weight: bold; padding-top: 20px">{{ field.label }} {{ field.text}}</div>
</td>
</tr>
{% endfor %}
{% for field in custom_fields at position 2 %}
<tr>
<td colspan="99">
<div style="font-weight: bold; padding-top: 20px">{{ field.text}}</div>
</td>
</tr>
{% endfor %}
Thank you. I thought as much when I read about how the themes are implemented.
For future reference, anybody who also needs this functionality, you need to learn Liquid language.
you can set your registration number as a default in Manager. Go to Business Details under settings. Your registration number is the Business Identifier.
this details can be entered in the Notes field and set as default too.
I guess I could use Business Identifier field to store the registration number, but businesses who
are obligated to pay VAT tax must also include their VAT registration number on their invoices
"KMKR. XXXXXXXXXX"
So it becomes
Business name
Address
Reg. nr.
KMKR.
Firstbank
Secondbank
Thirdbank
But no worries, I’ll acquaint myself with the Liquid language and sort it out later.
I assume it won’t be that difficult to implement.
All (or almost all) fields in Manager accept HTML code. So all the different information can, in fact, be inserted into the Business Identifier field in Business Details under Settings. That will display without any heading.
You can, as @sharpdrivetek suggested, use if conditionals to leave out headings, too. Personally, I’ve found it easier to use unless. Here, for example, if a snippet from a slight modification of the default, Plain, theme that eliminates the Notes field heading but lets any others you may have show: