Skip Navigation

[Closed] creating view with custom post and one to many relationship

This support ticket is created 4 years, 11 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
- 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/Karachi (GMT+05:00)

This topic contains 7 replies, has 2 voices.

Last updated by Waqar 4 years, 10 months ago.

Assisted by: Waqar.

Author
Posts
#1709519
template.png
QUERYFILTER.png
Front-End.png

Tell us what you are trying to do?
I have custom posts Members, and Members Activity with set of custom fields and one member to many member activities. I am trying to create template for Members that will display member info in the top of the template and under that view with member activities. My data is set so Member 1 have 2 activities, Member 2 have 3 activities, Member 3 have 1 activities, Member 4 have 2 Activities and Member 5 none. I can see them properly if I check Member post type.
My template will show properly Members part but will always show only one activity, if I change 'View with:' to different member it will not update values for activity, and if I use 'View on front-end' screen will not show activity view at all.

Is there any documentation that you are following?
I followed instruction on this page https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/?utm_source=viewsplugin&utm_campaign=views&utm_medium=edit-view-relationships-filter&utm_term=Querying%20and%20Displaying%20Child%20Posts

https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/?utm_source=viewsplugin&utm_campaign=views&utm_medium=edit-view-relationships-filter&utm_term=Querying%20and%20Displaying%20Child%20Posts

https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/?utm_source=postselector&utm_campaign=m2m&utm_medium=post-selector-documentation-link&utm_term=Documentation#displaying-many-related-items

Is there a similar example that we can see?

What is the link to your site?
Site is under development and only available internally

#1710153

Hi,

Welcome to Toolset support and I'd be happy to assist.

During testing on my own website, I was able to reproduce this behavior too.

When using a post view to show the related posts inside a single post content template, the results from the view in the preview pane are not changed on-the-fly, when the target post for the preview is changed through "View with" option on the top.

After switching the target post through "View with", you'll need to click the update button to save the content template and reload the content template edit screen to show the correct results from the view in the preview pane.

Thank you for bringing this forward and I've shared these findings with the concerned team for further review.

The good news is that this issue seems to be limited to only the preview pane and on the actual single post pages on the front-end, the related posts/results are shown correctly.

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1712701

So, can I actualy use this template or not?
when I use it on the page I can't see that view, how can I use this template to see the data on the site?

Dusan

#1713643

Thanks for writing back.

> So, can I actually use this template or not?

- Yes, you can use this content template for the single "Members" post pages, as the issue is limited to only the preview area in the back-end.

On the front-end, the enclosed view should be showing the related "Members Activity" posts correctly.

> when I use it on the page I can't see that view, how can I use this template to see the data on the site?

- In that view's query filter settings, it is set to show the related "Members Activity" posts, with respect to the post (which would be "Members" post in this case) where this view is shown.
( as shown in your screenshot "QUERYFILTER.png" )

That's the reason, testing this content template on a regular page, won't bring in the correct results from the view. Please test this content template on any single "Members" post page to see if the related "Members Activity" posts are showing or not.

In case the issue still persists, you're welcome to share temporary admin login details, along with the link to any single "Members" post page that you used for this testing.

Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.

#1720709
Edit.png
single-post.png

Hello,
I am making this site publicly available, in the mean time can you point me how to create and call page in the 'front end' since everything I tried can not get it to display the view.
In edit post I can see all of the info but if I use permalink to view the single post on the site view is not displayed.

#1722839

Thank you for sharing these screenshots and I apologize for the delay in getting back on this.

I did some more testing on my website, but I'm still not able to reproduce the issue of view not showing inside the content template.

This means that this issue seems to be specific to your website and I'll need the admin access to troubleshoot it.

If the website is now publicly available, you're welcome to share temporary admin login details in reply to this message, along with the link to an example page where the view should be showing, but is not.

Note: I've set your next reply as private again.

#1735867

So I did try beta version as suggested and here are results
1. stable version will not display lists associated to post using type relationship
a. removed stable version of toolset
b. install the beta version of toolset - view start working properly

2. reinstall WordPress
3. install beta version of toolset
b. recreate types and relationship
c. use the same files to import data into post type
d. verified data, data import worked fine for a post but no relations imported so my 'Member post' lost connection to related 'Activity' post, but all member and activity data is imported. I can manually assign 'Activity' to 'Member', then, relationship is working fine
4. uninstall the beta version of Toolset
5. install the stable version, data import works fine and relationship will be properly assigned, but the view will not work

I need help with this

#1737449

I'm sorry, but I couldn't find any mention or suggestion about the beta versions of the plugins.
( beta versions are for advanced users who'd like to test the upcoming features, but they should not be installed on the production websites. ref: https://toolset.com/faq/how-to-install-beta-and-development-versions-of-toolset-plugins/ )

We were just discussing the issue where related posts can't be shown on the front-end using the post views and I requested access to the website's admin area in my last reply.
( ref: https://toolset.com/forums/topic/creating-view-with-custom-post-and-one-to-many-relationship/#post-1722839 )

Can you please keep the production versions of the Toolset plugins on the website and then let me have the link to a page where the view should be showing the related posts, but isn't.

I'll also need temporary admin login details, to see how everything is set up in the backend.

Note: I've set your next reply as private again.

The topic ‘[Closed] creating view with custom post and one to many relationship’ is closed to new replies.