Skip Navigation

[Resolved] When retrieving results from checkboxes as list the first item is incorrect

This support ticket is created 6 years, 8 months 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 6 years, 8 months ago.

Assisted by: Christian Cox.

Author
Posts
#560410
Screen Shot 2017-08-16 at 8.33.29 AM.png
Screen Shot 2017-08-16 at 8.32.38 AM.png
Screen Shot 2017-08-16 at 6.59.29 AM.png

I am trying to: Accurately show a list when retrieving "checkboxes" results.

Link to a page where the issue can be seen: hidden link

I expected to see: All items wrapped within the < li > tag. All checkbox items are within the list, expect the first item, which seems to be outside the < li ></ li >.

Instead, I got: Example:

  • Item 1

  • Item 2
  • Item 3
  • , etc.

    #560476

    Hi, the issue here is that you're not opening and closing your list item tags correctly. This code will work better because it starts the first li tag and closes the first tag, with closing tags separating each item as well:

    <ul class="amenities-list">
      <li>[types field='amenities-services' separator='</li><li>'][/types]</li>
    </ul>
    

    ..but if no amenities services items are found, this will result in a blank li tag.

    There are a couple other samples over here you might find useful, including a foreach example that would fix the blank li tag I mentioned:
    https://toolset.com/documentation/user-guides/repeating-fields/

    Let me know if you have any questions about this.

    This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.