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
forloop. - Between the
fortag and theendfortag, put the text to show for each item. - After
for, enter a name for each item in the list.
Example:
{% for tag in animal.Tags %}
{{ animal.Name }}: {{ tag.Name }}
{% endfor %}In this example:
animal.Tagsis the list of the tags of the record.tagis the name for each item in the list.animal.Nameshows the name of the patient. The name of the patient is the same for each tag.tag.Nameshows 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.CreatedTimeshows the date and time that a staff member made the record.- The
dateformatfilter 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 for | Enter | Example |
|---|---|---|
| A patient | animal | {{ animal.Id }} |
| A contact | contact | {{ contact.Id }} |
| An invoice | invoice | {{ invoice.Id }} |
| An invoice line item | invoiceline | {{ invoiceline.Id }} |
| A payment | payment | {{ payment.Id }} |
| A medication | medication | {{ medication.Id }} |
| An estimate | quotation | {{ quotation.Id }} |
| A clinical record | consult | {{ consult.Id }} |
| A product | product | {{ product.Id }} |
| Name | Classic template system equivalent? | Function |
|---|---|---|
{{ animal.Id }} | No | Shows the ID of the record. Note: The ID is the internal number that ezyVet uses for the record. |
{{ animal.Number }} | No | Shows the number of the record, for example the invoice number or the patient number. |
{{ animal.Code }} | No | Shows the code of the record. Note: This variable is applicable to record types that have a code. |
{{ animal.Tags }} | No | Shows a list of the tags of the record. Note: Use this variable in a Twig for loop. For example:For more information, refer to Variables that show a list. |
{{ animal.AllTags }} | No | Shows a list of all tags of the record, with the inherited tags. |
{{ animal.InheritedTags }} | No | Shows a list of the inherited tags of the record, for example the tags that a patient inherits from the owner of the patient. |
{{ animal.CreatedTime }} | No | Shows the date and time that a staff member made the record. Note: You can also enter {{ animal.CreationTime }}. |
{{ animal.AdditionalComments }} | No | Shows all comments of the record. |
{{ animal.AdditionalCommentsInternal }} | No | Shows the internal comments of the record. |
{{ animal.AdditionalCommentsExternal }} | No | Shows the external comments of the record. Note: Clients can see external comments. |
{{ animal.OwnershipSeparationName }} | No | Shows the name of the business unit of the record. |
{{ animal.OwnershipSeparation }} | No | Shows the business unit record of the record. Tip: To show the department, enter {{ animal.DivisionSeparation }}. |
{{ animal.PrintableName }} | No | Shows 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 }} | No | Shows 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 }}). |