Skip Navigation

[Resolved] Displaying multi-item fields as separate list items

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to display repeating field / multiple instance field with ul/li

Solution:
You can use "separator" with types shortcode to display repeating field.

For example:

<ul>
 <li>[types field="patent-number" separator="</li><li>"][/types]</li>
</ul>

Relevant Documentation:=> https://toolset.com/documentation/user-guides/repeating-fields/#Displaying%20Repeating%20Fields

This support ticket is created 6 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 8 replies, has 2 voices.

Last updated by johnB-37 6 years, 1 month ago.

Assisted by: Minesh.

Author
Posts
#1122903

Hi there,
I have a custom field called "Patent Number" that can have multiple instances. I'd like to display this field and its contents on the front end in an HTML list, with each instance being a separate list item. So if there are 4 values in the field, then there would be 4

  • on the front end.
    The page is here:
    hidden link

    You can see on the left side, under Contact, the page is listing all the items together in one list item. There are 5 values for this field so I'd like there to be 5 list items. I realize I could just make multiple fields like Patent Number #1, Patent Number 2, etc. but I think would be confusing for people editing content, and the number of values for this field will vary.

  • #1123517

    Minesh
    Supporter

    Languages: English (English )

    Timezone: Asia/Kolkata (GMT+05:30)

    Hello. Thank you for contacting the Toolset support.

    Well - what if you use the following method:

    <ul>
     <li>[types field="patent-number" separator="</li><li>"][/types]</li>
    </ul>
    

    More info:
    => https://toolset.com/documentation/user-guides/repeating-fields/#Displaying%20Repeating%20Fields

    #1123695

    My issue is resolved now. Thank you!

    #1123892

    Hi there,
    Me again. So I had one additional question. The solution works great, except on this page:
    hidden link

    if you scroll down to the Awards section, you will see there are four values for the field displayed, but the first one does not have a list item tag around it, but it is in unordered list.

    Thanks for any help!

    #1124332

    Minesh
    Supporter

    Languages: English (English )

    Timezone: Asia/Kolkata (GMT+05:30)

    Could you please close this ticket.

    We will continue with your new issue with the following ticket:
    => https://toolset.com/forums/topic/split-displaying-multi-item-fields-as-separate-list-items-li-not-rendering-on-specific-page/#post-1124331

    #1124634

    Minesh
    Supporter

    Languages: English (English )

    Timezone: Asia/Kolkata (GMT+05:30)

    Could you please close this ticket as well 🙂

    #1124636

    Minesh, I thought i already closed this ticket but perhaps I didn't.
    When I try to close it now, I get this message: ERROR: Duplicate reply detected; it looks as though you’ve already said that!

    #1124640

    Minesh
    Supporter

    Languages: English (English )

    Timezone: Asia/Kolkata (GMT+05:30)

    Could you please try to close with different message.

    #1124641

    For sure this time, this issue is resolved!