I’m in the middle of creating my report template and I wanted it to show the student’s age.
I tried {{student.age}} but it isn’t working, is there anything that I can replace to show student age in the cover page I’m editing right now?
The student fields that you can use in this Twig template come from the following file:
/modules/Reports/src/Sources/Student.php
In this file you’ll not find an age field, but you will find dob, which returns YYYY-MM-DD. You should be able to use this to work out and display the age in the template.
It may be helpful to note that the Preview option can let you know what data sources and fields are available when writing the template. Be sure that Debug Mode is on in Report Settings, then when you click Preview there will be a small expandable Inspect option, which displays the available data (fake data, in the case of a preview).