I have the following piece of HTML:
<li style="margin-bottom: 3px; margin-top: 3px">Vendor accounts:</li>
{% if fact_foundVendorList is defined and fact_foundVendorList|length > 0 %}
{% for vendor in fact_foundVendorList %}
<ul>
<li style="margin-bottom: 3px; margin-top: 3px">{{ vendor }}</li>
</ul>
{% endfor %}
{%- else -%}
No accounts were found for the user
{%- endif -%}
When the if fact_foundVendorList returns to be false, it will look like this:
* Vendor accounts:
No vendor accounts were found for the user
Otherwise, it would like something like:
* Vendor accounts:
* account1
* account2
I only want to change the false output. In case it's false I want to have the message in the same line as the "vendor accounts" line. So it should look like this:
* Vendor accounts: No accounts were found for the user.
I thought adding the following %- -% would work, but I think I need something else
{%- else -%}
No accounts were found for the user
{%- endif -%}
I saw various related solutions online but couldn't apply it to my case without breaking the structure of the <ul> and <li> tags in my template. It's a long document.