Navigation überspringen

[Gelöst] Multiple Instance Field Output Formatting

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem:

I have a few multiple Instance fields (Single Line) that contain multiple lines of data. I would like to display the data in a pseudo table format.

Solution:

You can setup the HTML table tags with [wpv-for-each] to display the result as what you want,

Relevant Documentation:

https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-for-each

This support ticket is created vor 4 Jahren, 4 Monaten. 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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

Dieses Thema enthält 5 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von larryL vor 4 Jahren, 4 Monaten.

Assistiert von: Luo Yang.

Author
Artikel
#1723263
Capture.PNG

I have a few multiple Instance fields (Single Line) that contain multiple lines of data. I would like to display the data in a pseudo table format.

For example the three fields type, zone, description.

And each field could have upwards of 30 or 50 entries PER POST at any give time.

I'd like to display it as attached.

Right now it only displays as CSV in each field.
Thanks!

#1723517

Hello,

I suggest you try to setup the HTML table tags with [wpv-for-each] to display the result as what you want, see our document:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-for-each
Iterate through multiple items in a post meta field and output the enclosed text for each item. Including Types repeating fields.

#1724257

I'm getting 'No items found'

The listing is a related view. I've selected it as many different ways in the filter as I can think of but either it says 'no items found' OR I get a super long table with nothing in any of the columns. When it displays simply as CSV I'm using {!{types field='zone' separator=', ' item='@location-access-contact.child'}!}{!{/types}!} What do I need to do in the [wpv-for-each] or in the filter differently to make this work?

Thanks!

#1725313

First, [wpv-for-each] won't output result 'No items found'.

How do you setup the post type relationship "location-access-contact"?
Where do you display the shortcode you mentioned above:
{!{types field='zone' separator=', ' item='@location-access-contact.child'}!}{!{/types}!}

If it is one-to-many relationship, you can follow our document to setup the child post view:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-many-related-items

Then follow the document I mentioned above to display [wpv-for-each] shortcode:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-for-each

#1726565

OK, I figured out the issue, it had nothing to do with the relationship. It was that I was mixing types and wpv-post-field lines from the previous example. I've got that part sorted out. Thanks!

#1726567

My issue is resolved now. Thank you!