Code to enter instructions if text is not present
Here is a useful code line to enter instructions if a certain text field is empty:
Different Format (two alternatives): Text or Guidance
Vision: {% if project.project_vision|striptags %}{{ project.project_vision }}{% else %}Conservation standards guidelines on what to put in this section {% endif %}
{% set guidance = 'Conservation standards guidelines on what to put in this section' %}Vision: {% if project.project_vision|striptags %}{{ project.project_vision }}{% else %}{{ guidance }}{% endif %}
Same Format: Text or Guidance
Vision: {{ project.project_vision|striptags|default('Conservation standards guidelines on what to put in this section', true) }}
-
Hi Charles, thank you for sharing! Would you be able to share some explanations on how to build this, or maybe point to a resource providing guidance on how to write/read this type of code?
Thanks!0 -
Hi Diane,
You can see more information on creating custom report document templates here.
Cheers,
0
Please sign in to leave a comment.
Comments
2 comments