1. Bigle Academy
  2. Templates - Create tags
  3. Types of use of opening and closing tags

Tags for plural or singular

Some tags give the document the ability to adjust automatically to plural or singular.

To understand these tags’ utility, we are going to use a fragment of a Lease Agreement as an example, in which there can be one or several tenants renting a property.

Let us begin with the following text:

Mr./Mrs. ______________, with Spanish nationality, residing at ______________, and holder of ID number ______________.

Hereinafter referred to as the “Tenant”.

 

First of all, we are going to put all the text corresponding to the tenant into opening and closing tags, so we can transform it into a multiple section (read the article).

{#tenant}Mr./Mrs. ______________, with Spanish nationality, residing at ______________, and holder of ID number ______________.

{/tenant}
Hereinafter referred to as the “Tenant”.


This will enable the document to provide information from as many tenants as possible. Furthermore, we will have to make the last sentence of the example adaptable to singular or plural, according to the number of tenants.

Let us see how this works.

 

By adding the suffix LENGTH to the tag of a multiple section, we are indicating to the software whether the information needs to be inserted in singular or plural. Thus, if there are, for example, two tenants, the software will introduce the information in plural. Otherwise, if there is only one tenant, the information will be shown in singular.

As we can see in the example below, we will use the opening and closing tags of a multiple section by adding the suffix LENGTH and writing “==1” after it, to enclose the text to be shown when there is a single tenant; and “>1”, to enclose the text to be shown for multiple tenants.

{#tenant}Mr./Mrs. ______________, with Spanish nationality, residing at ______________, and holder of ID number ______________.

{/tenant}
Hereinafter referred to as{#tenantLENGTH ==1} the “Tenant”{/}{#tenantLENGTH >1} the "Tenants"{/}.

 

This is the structure we described:

  1. Both the plural and singular texts are included into opening {#} and closing {/} tags.
  2. We will only need to use the keyboard slash to close the tag {/}. (This way, it is easier 😉).
  3. The opening tags have a condition, which allows us to distinguish the singular and plural cases:
    1. The first word we will find is “tenant”. It is the word we used to include all the text corresponding to the tenant at the start of the explanation; and this tag depends on it. Also, this is the word we will have to use to make the “Tenant section” multiple while setting up the form.
    2. Then, we will use the suffix “LENGTH”, which added right after “tenant” will allow us to recover the amount of tenants.
    3. Finally, we define the condition: 
      1. If there is only one tenant (==1), the document will say the “Tenant".
      2. If there are more than one tenant (>1), the document will say the “Tenants”.

 

To summarize, thanks to this configuration, if there is only one tenant in the document the text will be shown in singular. Conversely, if there are more than one tenant, the text will be converted into plural.

 

Below is an example video: