rdmorganiser / rdmo

A tool to support the planning, implementation, and organization of research data management.
https://rdmorganiser.github.io
Apache License 2.0
103 stars 49 forks source link

Collections in Views #105

Closed skelligan closed 5 years ago

skelligan commented 5 years ago

If I understand the documentation at https://rdmo.readthedocs.io/de/latest/management/views.html correctly, the following statements should produce the same output, one with an inline-list, the other one with a multi-line list: 1) {% render_value_inline_list 'project/general/basics/management' %} 2)

<ul>
{% for i in 'project/general/basics/management' %}
    <li>{% render_value i %}</li>
{% endfor %}
</ul>

However, while the first statement producing an inline-list works fine, the second statement only produces loads of bullets with no text at all. Am I doing something wrong or does this not work as intended?

PS. The documentation is not consistent between the German and English version where the attributes and their values are explained.

jochenklar commented 5 years ago

Hi, the documentation is wrong here, we will fix this.

You can get the multi-line list with

<ul>
{% render_value_list 'individual/collection/text' %}
</ul>

or

<ul>
{% get_values 'individual/collection/text' set_index=0 as text %}
{% for value in text %}
    <li>{{ value.value }}</li>
{% endfor %}
</ul>

do the same. We will try to make the views more consitent in the future.

skelligan commented 5 years ago

Great, thank you for your help.

triole commented 5 years ago

Closing as it seems to be settled.