Skip Navigation

[Resolved] View only shows one post

This support ticket is created 5 years, 9 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.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 4 replies, has 2 voices.

Last updated by jesperK 5 years, 9 months ago.

Assisted by: Nigel.

Author
Posts
#1234854

I am trying to:
Create a list of selectable Exhibitors(Udstillere) on an event page. And then show the data.

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

I expected to see:
Two Exhibitors not one

Instead, I got:
One Exhibitor

My setup is like this:
cpt: Event, Exhibitors (Udstillere), Select Exhibitor (Select-udstiller)

Relationship:
Events [*] << Events Select Udstillere >> Select Udstillere [*]
Udstillere [*] << Udstillere Select Udstillere >> Select Udstillere [*]

The View:
Content Selection: Select Udstillere
Query Filter: in any relationship ->The post where this View is shown

<a href='[wpv-post-url item="@udstiller-select-udstiller.parent"]'>
[wpv-post-featured-image size="custom" width="300" height="300" item="@udstiller-select-udstiller.parent"]
[types field='stand-nummer' item="@udstiller-select-udstiller.parent"][/types]
  [wpv-post-title item="@udstiller-select-udstiller.parent"]
</a>
#1234876

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Jesper

So, the starting point is an events page.

You have a View to query "Select Exhibitor" posts related to the current event.

Then for each of the returned "Select Exhibitor" posts, output fields from the Exhibitor post connected to that Select Exhibitor post.

If you are only seeing content for one Exhibitor then it sounds like the View is only returning one Select Exhibitor post connected to the Event.

As a test, in the output section of the View simply output the post title (i.e. of the Select Exhibitor post itself). Then go to the backend edit screen for the Event and in the post relationships metaboxes double-check which Select Exhibitor posts are connected. Do the two match?

#1234903
3_on_the_frontend_event_page.png
2_on_the_select_udstillere_SOP19.png
1_on_the backend_event_page.png

Hi Nigel

It is properly something really simple.

Now I have uploaded three images:
1. Showing the event page backend list called SOP19
2. Showing the content of SOP19 – the connected exhibitors "udstillere"
3. Showing the front page where only one post shows.

I have tried to delete the list and make a new and the problem is the same only the first connected post show.
The first list show only canon and this new one show only zünd. Even though both of the lists had both Exhibitors.

#1234922

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

But the problem is right there in your screenshot 1.

The event which is your starting point has only one Select Exhibitor post connected (SOP19).

So the View to query the Select Exhibitor posts connected to the Event correctly returns only that one Select Exhibitor post.

Now, that same Select Exhibitor post is connected to multiple Exhibitor posts.

If you want to output fields from each of those connected Exhibitor posts then you must create another View (nested in the output of the first View) which gets the Exhibitor posts connected to the current Select Exhibitor post, and then in the output of that View you can print the Exhibitor fields directly (no need for the item attributes).

So in the above case if you had Canon and Zünd both connected to the SOP19 Select Exhibitor post then the second View would be iterating over Canon and then Zünd.

(I'm not sure why you are using two M2M relationships in this way rather than connecting Events to Exhibitors directly—using relationship fields as needed—but that's another issue...)

#1234986

I needed the nested views as you suggested. Thank you very much Nigel – just the help I needed.

So the solution in my case was two views:
Child view -> Call all Exhibitors and define a relationship with a filter query shortcode attribute
Parent view -> Call the child view inside the parent view and get the selected Exhibitors posts with the use the parameter selectid="[wpv-post-id id="$select-udstillere"] in the shortcode