Ordered list

Support MB Views Ordered listResolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #27619
    ameneses67@gmail.com[email protected]
    Participant

    Hi,

    I created this view for a relationship:

    {% set relationship = attribute( relationships, 'curso-capitulos' ) %}
    {% for post in relationship.to %}

    1. {{ post.title }}

    {% endfor %}

    I want to display the post titles as an ordered list, but it assigns number 1 to each post title instead of following a sequence.

    https://www.screencast.com/t/URyO7wIF1vjb

    How can I make it work?

    Thanks,

    #27625
    Long NguyenLong Nguyen
    Moderator

    Hi Ameneses,

    Thank you for reaching out.

    You need to use the HTML ordered lists <ol><li></li></ol> display the post titles as an ordered list, get more details here https://www.w3schools.com/html/html_lists_ordered.asp

    The code should be

    <ol>
    {% set relationship = attribute( relationships, 'curso-capitulos' ) %}
    {% for post in relationship.to %}
    
    <li>{{ post.title }}</li>
    {% endfor %}
    
    </ol>
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.