Skip Navigation

[Geschlossen] Displaying repeating fields in different rows

This support ticket is created vor 8 Jahre, 2 Monate. 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)

This topic contains 12 Antworten, has 2 Stimmen.

Last updated by Luo Yang vor 8 Jahre, 2 Monate.

Assigned support staff: Luo Yang.

Author
Artikel
#260990
Captura de pantalla 2014-11-06 10.14.20.png

Hi,

I have created a view that contains a table which display different events in a day. Some events are in diferent days and for this i have created a specific shortcode (that allow show only the hour corresponding with the day). To sort the table I have used tablesorter js.

Now I have a problem with some events. When the event have different hours in the same day, the table display all the hours in the same row and they are not sorted with the rest of the events.

I attached a screenshot where you can see the first event with different hours and no sorted with the rest in the table.

Then, I would like that each hour of this kind of event (with a repeating field of hour) display in diferent rows.

Not like this

16:00 Homenaje a Herny Langlois
19:00
21:30
21:00 Rulo y la Contrabanda
21:00 Echo & the bunnymen
21:00 Ranking Joe + Morodo
21:00 Gino Vannelli + Thomas Anders (Modern Talking)
22:30 Francisca Valenzuela: Tajo abierto

Like this:

16:00 Homenaje a Herny Langlois
19:00 Homenaje a Herny Langlois
21:00 Rulo y la Contrabanda
21:00 Echo & the bunnymen
21:00 Ranking Joe + Morodo
21:00 Gino Vannelli + Thomas Anders (Modern Talking)
21:30 Homenaje a Herny Langlois
22:30 Francisca Valenzuela: Tajo abierto

It would be possible?

Thanks in advance!

#261132

Luo Yang
Supporter

Languages: Englisch (English ) Vereinfachtes Chinesisch (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

That is not possible within Views, it can be only one row for one post in your view result.

But you can try create a child post type(for example "event date type"), and add a single custom date field(for example "event date field") in post type "event date type". each child post stores only one field "event date field"

In your view, you will be able to query the posts of child post type "event date type", and display the parent post title and links. each "event date field" will be able to display in different rows

#262045

Luo Yang
Supporter

Languages: Englisch (English ) Vereinfachtes Chinesisch (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Are you going to display the events of today or tomorrow?
If it is tomorrow's events, please try modify the filter as:
Select posts with custom field:
horario-multiple BETWEEN FUTURE_DAY(1), FUTURE_DAY(2)

And make sure the filter is using Comparison function: between NUMERIC

Here is a test site for you:
hidden link
user/pass: xgren/111111

Views using:
hidden link

More help:
Date Filters
https://toolset.com/documentation/user-guides/date-filters/

#262068

Thanks Iuoy,

It works almost perfecty, but still has a problem. I have created a test page: hidden link where all fields are displayed correctly except row "lugar", I think because is a field from a parent post ("Lugares"). I tried to display in table like this:

<td class="agenda">[wpv-post-link id="$lugar"]</td>

But It doesn't display correctly. Instead displaying field the title post link from "lugar" (Bar Mala Vida) it displays the child post title link from "fecha" ("fecha 4081" and "fecha 4082")

#262072

Luo Yang
Supporter

Languages: Englisch (English ) Vereinfachtes Chinesisch (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

What is the slug of the parent post type "Lugares" using?
If it is "lugares", you will need change above codes as below:
[wpv-post-link id="$lugares"]

You can get it by goto your WP admin side, Types-> Types & Taxonomies
find the post type "Lugares", and click "Edit", there is an option "Slug (required)"

If the problem still exists, please try duplicate same problem in above test site, I need debug in a live website. thanks

#262163

Thanks Iuoy,

I duplicate problem in test site. As you can see, in the last row is displaying the title of the child post, not title of parent (really grand parent) (Bar Raíces and Bar Mala Vida)

#262284

Luo Yang
Supporter

Languages: Englisch (English ) Vereinfachtes Chinesisch (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

OK, it is grand parent post type of current post
please try like this:

[wpv-post-link id='[wpv-post-field name="_wpcf_belongs_lugar_id" id="$event"]']

you can use [wpv-post-field name="_wpcf_belongs_lugar_id" id="$event"] to get the grand parent lugar post ID,
See the demo site:
hidden link

and I have removed the date filter to test.

#262301

Thanks luoy, now table displays all fields perfectly. But now I have a new problem. In original view: hidden link there is a filter (excluding Category "Niños") and three filter controls (Area, Comuna and Precio), and they works fine. But with the new sistem (hidden link) I can't use this filter and filter controls because they are from parent post. How could I solve it?

#262550

Luo Yang
Supporter

Languages: Englisch (English ) Vereinfachtes Chinesisch (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

You can try setup a nested view,
a) parent view list terms (excluding Category "Niños"),
b) child view list posts under the term of parent view

More help:
Views Inside Views – Display Nested Multidimensional Lists
https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/

#262673

Thanks Luoy, but I don't understand very well.

I have created a view with categories (excluding "Niños") but I don't know how say that this view is parent of other view post. I put in the code html [wpv-view name="prueba-fechasmultiples"], where "prueba-fechasmultiples" is the parent view.

In the other hand, I think this only can solve the problem of exclude a category in the view but I don't know how can I make for activate again filters (Area, Comuna and Precio) because they are from parent post. Here: hidden link if you see, the filters doesn't work. I try putting "id="$post" inside diferent "wpv-control" but doesn´t change anything.

#263191

Luo Yang
Supporter

Languages: Englisch (English ) Vereinfachtes Chinesisch (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

I assume the custom taxonomies: categories, Area, Comuna and Precio is register to the parent post type "Event", in your case you will need register them to the child post type "fechas", and setup each child posts's categories, Area, Comuna and Precio value, then the filter should works.

#263224

Thanks Luoy, but is not a solution useful for me because if I has a event with 50 diferent dates I must write or setup 50 times the same taxonomies and fields. Is there not a way for use the parent fields/taxonomies in filters?
In the other hand, I continue without exclude a category from the list of post. I created a view with categories but I don't know how say that this view is parent of other view post.

#263483

Luo Yang
Supporter

Languages: Englisch (English ) Vereinfachtes Chinesisch (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Sorry there isn't other workaround within Views, since you are going to display each item as a row, and need order it using the time stamp, and using the front-end form to filter the posts,
If you use nested view, add filter form in the parent form, the child items can not be ordered by the date-time field, it will be ordered by the parent "event" posts.

Or you can check out our certified partners for it:
https://toolset.com/consultant/

Das Thema „[Geschlossen] Displaying repeating fields in different rows“ ist für neue Antworten geschlossen.