2
0
mirror of https://github.com/inventree/inventree-docs.git synced 2025-09-13 22:21:33 +00:00

Extend documentation about loading media files (#317)

Fixes #312
This commit is contained in:
Miklós Márton
2022-07-22 00:03:06 +02:00
committed by GitHub
parent 0a3f6a45cf
commit 185e2b9c29
2 changed files with 45 additions and 0 deletions

41
docs/report/media.md Normal file
View File

@@ -0,0 +1,41 @@
---
title: Using media files
---
## Images
To load images into the reports/labels the report helper must be loaded in the template.
```html
{% raw %}
<!-- Load the report helper functions -->
{% load report %}
{% endraw %}
```
### Assets
You can add images to the reports and labels by using the asset template tag:
```html
{% raw %}
<!-- Load the report helper functions -->
{% load report %}
<img src="{% asset 'my_awesome_logo.png' %}"/>
{% endraw %}
```
!!! info "Assets location"
You need to place your asset images to the report/assets directory in the [data directory](../start/docker_dev.md/#data-directory)
### Part images
You can render the images of the parts using the part_image template tag:
```html
{% raw %}
<!-- Load the report helper functions -->
{% load report %}
<img src='{% part_image part %}'/>
{% endraw %}
```