Skip Navigation

[Resolved] How to implement a viewblock with dynamic behavior?

This thread is resolved. Here is a description of the problem and solution.

Problem:

When I create an archive page or a single page, I want to automatically load the relevant product for each post.

Solution:

I suggest you try many-to-many relationship, for example:

https://toolset.com/forums/topic/how-to-implement-a-viewblock-with-dynamic-behavior/#post-2288373

Relevant Documentation:

https://toolset.com/course-lesson/displaying-related-posts/#displaying-many-related-items

This support ticket is created 2 years, 10 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/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by junkyuJ 2 years, 10 months ago.

Assisted by: Luo Yang.

Author
Posts
#2288357

Tell us what you are trying to do?

I am creating an affiliate site. When I create an archive page or a single page, I want to automatically load the relevant product for each post.

Let's take an example of a monitor. If you write an article about monitor recommendation and comparative analysis, only monitor-related products will be automatically uploaded.

It's okay to enter it manually, but if there are more than 100 posts, it's a task to load them one by one.
How can I implement a dynamic view block?

Is there any documentation that you are following?

No

Is there a similar example that we can see?

No It's first time.

What is the link to your site?
hidden link

#2288373

Hello,

I suggest you try these:
1) Setup many-to-many relationship between post types "post" and "product"
2) Edit each "post", connect it with other "product" posts
https://toolset.com/course-lesson/how-to-set-up-post-relationships-in-wordpress/

In single "post", display a view block:
- Query "product" posts
- Filter by post type relationship between "post" and "product"
- In view's loop, display "product" infomation
https://toolset.com/course-lesson/displaying-related-posts/#displaying-many-related-items

#2291339

My issue is resolved now. Thank you!