Hello,
I'm using the form plugin to save user generated html from submitted data. Below is the default data.html.twig code that generates these pages in the form plugin.
I'd like to add the current users $username to the page thats generated. Could anyone be so kind as to explain how to go about doing that?
'''
{% for index, field in form.fields %}
{% set input = attribute(field, "input@") %}
{% if input is null or input == true %}
{% block field %}
<div>
{% block field_label %}
<strong>{{ field.label }}</strong>:
{% endblock %}
{% block field_value %}
{{ string(form.value(field.name ?? index))|nl2br }}
{% endblock %}
</div>
{% endblock %}
{% endif %}
{% endfor %}
'''
My overall aim is to later recall the pages that are submitted, for the user to see, using the submitted $username.