Skip to content

Read template should use more structured HTML #34

@caktus-philip

Description

@caktus-philip

The current read template puts the fields and field values into a single DIV and separates them by <br> tags. The code is below for reference.

I have two suggestions for improvement. First, wrap each field label + value in a block element (div, p, or li). That would make them a lot easier to style and more friendly to screen readers and content scrapers.

Second, add a class or id to the containing div to make it CSS-helpful.

<div>
  {# we have a form, just to make it easy to go through the data and display it #}
  {% for field in form %}
    <br/>
    {{ field.label_tag }} {{ field.value }}
  {% endfor %}
</div>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions