• Creator
    Topic
  • #27619

    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,

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #27625
    Long 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 1 replies (of 1 total)
  • You must be logged in to reply to this topic.