All crucial fields are editable, with the most important being Type, Template, and Report Types.
While there are several prebuilt product types available, users also have the option to create their own product types using custom templates.
It can be beneficial to create custom Product Types to meet desired results with the publishers.
This is an example to render arbitrary values and loop over attributes.
src/core/core/static/presenter_templates
,TITLE: {{ data.report_items[0].get('title') | default('No title provided', true) }}<br>
DATE CREATED: {{ data.report_items[0].get('created') | default('Not available', true) }}<br>
LAST UPDATED: {{ data.report_items[0].get('last_updated') | default('Not available', true) }}<br>
{% for name, attribute in data.report_items[0].get('attributes').items() %}
{{ name }}: {{ attribute }}<br>
{% endfor %}
If one is interested in creating own templates, it is a good to start to render the object {{ data }}
first, to understand how to parse the object properly.
It is also possible to copy src/core/core/static/presenter_templates/<new-custom-template.txt>
to a dynamic folder src/core/taranis_data/presenter_templates
so the restart is not necessary.
If needed, templates can be utilized for more complex renderings by leveraging custom attributes.
Currently, this functionality is demonstrated in the text_template.txt
file, where the attribute omission
of type “Omit Keys” allows for the exclusion of unnecessary attributes from publication. To employ this feature, the administrator simply needs to add this attribute to the relevant report type. Then, within a specific report (Analyze View), they can specify the attributes to omit by listing them as comma-separated strings.
It is essential to ensure that the “Name” used for the report type attribute matches exactly with the key used in the template.