# Templates Templates are Jinja2 HTML files that define how your action results are displayed. They receive data from view handlers and render it into the final HTML that users see in the SOAR interface. For Jinja2 syntax and features, see the [official Jinja2 documentation](https://jinja.palletsprojects.com/en/stable/). ## Template Location Store your templates in the `templates/` directory of your app: ``` my_app/ ├── src/ │ └── app.py ├── templates/ │ ├── detection_results.html │ ├── user_summary.html │ └── scan_report.html └── pyproject.toml ``` ### SDK-Specific Filters The SOAR SDK provides custom filters for common needs: ```html
Modified: {{ last_modified|human_datetime }}
Count: {{ total_items|safe_intcomma }}
``` **Important:** Use `|safe` when outputting JSON data or pre-sanitized HTML. Normal text and variables are automatically escaped. ## Widget Templates All custom views in SOAR use the widget template system, providing consistent styling and functionality. **Note:** You can also create fully custom templates without extending any base should it be desired. ### Base Template Options Choose a base header. The base headers sets up base template defining widget structure, styling, standard functionality like resizing. #### `base/logo_header.html` Use when you want your app's logo in the widget header (most common). ```html {% extends 'base/logo_header.html' %} {% block widget_content %}{{ my_data }}
{{ my_data }}
Status: {{ service.status }}
Uptime: {{ service.uptime }}