REPORTS: support more criteria type

Hello, I realized when creating reports criteria sometimes theres need for images and other file types. How can we include more under “manage criteria types”.

Thanks

Hi Kelvin,

We could look at adding images as a possible criteria type, however, they would generally require some customizations to a template before they could be used and aren’t supported by the default templates. As the reports end up as a PDF, adding other files into the reports isn’t necessarily possible.

You could currently add images using a URL, as long as your criteria type is text, and you modify your template to treat the criteria value as a URL for an image. This might get you up and running with images without needing core changes to begin with.

1 Like

Sounds good as this would not require major core changes… it’s just to learn how to handle image URL in component prototyping (twig)

Hi Kelvin, here’s an example of working with an image, in this case the student’s profile image, but any image that is relative to the uploads directory can be used. If the full https:// path is provided, then you could remove the basePath variable.

{% if student.image_240 %}

{% endif %}

1 Like