home

Browse documentation

ezyVet Knowledge Center

Get access to documentation, training, and other high-quality resources.

Twig template variables: Variables on every record

Each variable works with all record types (for example, the ID and the tags of a record).

Variables that show a list

Some of these variables show a list. For example, animal.Tags shows a list of the tags of the record.

To use a variable of this type:

  • Put the variable in a Twig for loop.
  • Between the for tag and the endfor tag, put the text to show for each item.
  • After for, enter a name for each item in the list.
Note: Use the same name in the variables in the loop.

Example:

{% for tag in animal.Tags %}
{{ animal.Name }}: {{ tag.Name }}
{% endfor %}

In this example:

  • animal.Tags is the list of the tags of the record.
  • tag is the name for each item in the list.
  • animal.Name shows the name of the patient. The name of the patient is the same for each tag.
  • tag.Name shows the name of each tag.
  • The document shows the text between the tags one time for each item in the list.

Variables that show a date

Some of these variables show a date. To show the date in a format that is easy to read, use the dateformat Twig filter. The Function column of each variable of this type has a note about the dateformat filter.

After the variable name, enter a vertical bar and dateformat.

Example:

{{ animal.CreatedTime|dateformat }}

In this example:

  • animal.CreatedTime shows the date and time that a staff member made the record.
  • The dateformat filter shows the date in a format that is easy to read.

Variables

The examples use animal. To use a variable in a different template, replace animal with the word in this table:

If your template is forEnterExample
A patientanimal{{ animal.Id }}
A contactcontact{{ contact.Id }}
An invoiceinvoice{{ invoice.Id }}
An invoice line iteminvoiceline{{ invoiceline.Id }}
A paymentpayment{{ payment.Id }}
A medicationmedication{{ medication.Id }}
An estimatequotation{{ quotation.Id }}
A clinical recordconsult{{ consult.Id }}
A productproduct{{ product.Id }}
NameClassic template system equivalent?Function
{{ animal.Id }}NoShows the ID of the record.
Note: The ID is the internal number that ezyVet uses for the record.
{{ animal.Number }}NoShows the number of the record, for example the invoice number or the patient number.
{{ animal.Code }}NoShows the code of the record.
Note: This variable is applicable to record types that have a code.
{{ animal.Tags }}NoShows a list of the tags of the record.
Note: Use this variable in a Twig for loop. For example:
{% for tag in animal.Tags %}
  {{ tag.Name }}
{% endfor %}
For more information, refer to Variables that show a list.
{{ animal.AllTags }}NoShows a list of all tags of the record, with the inherited tags.
Note: Use this variable in a Twig for loop. Refer to Variables that show a list.
{{ animal.InheritedTags }}NoShows a list of the inherited tags of the record, for example the tags that a patient inherits from the owner of the patient.
Note: Use this variable in a Twig for loop. Refer to Variables that show a list.
{{ animal.CreatedTime }}NoShows the date and time that a staff member made the record.
Note: Use this variable with the dateformat Twig filter. Refer to Variables that show a date.
Note: You can also enter {{ animal.CreationTime }}.
{{ animal.AdditionalComments }}NoShows all comments of the record.
{{ animal.AdditionalCommentsInternal }}NoShows the internal comments of the record.
{{ animal.AdditionalCommentsExternal }}NoShows the external comments of the record.
Note: Clients can see external comments.
{{ animal.OwnershipSeparationName }}NoShows the name of the business unit of the record.
{{ animal.OwnershipSeparation }}NoShows the business unit record of the record.
Tip: To show the department, enter {{ animal.DivisionSeparation }}.
{{ animal.PrintableName }}NoShows the printable name of the record.
Note: If the record does not have a printable name, this variable shows the name of the record.
{{ animal.Initials }}NoShows the initials of the record.
Note: Only user records have initials. This variable shows no value for other records (for example, a patient or a contact).
Tip: Use this variable after a variable that shows a user record (for example, {{ invoice.User.Initials }} or {{ vetuser.Initials }}).