Home › Toolset Professional Support › [Resolved] issue regarding the display custom post, which is in relationship with the curre
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 |
---|---|---|---|---|---|---|
- | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10: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/Kolkata (GMT+05:30)
This topic contains 15 replies, has 3 voices.
Last updated by ericF-5 3 years, 3 months ago.
Assisted by: Minesh.
Hello,
I am facing the issue regarding the display custom post, which is in relationship with the current post. Here are the details.
First, I have created the custom post type for the FAQ and then created the relationship with the product ( FAQ - One to Product - Many ). I am trying to edit the existing product template, which contains some views and blocks.
Now when I add the toolset view for the FAQs that are related to the current product, the toolset block setting inside the loops does not allow me to add dynamic content for the FAQ. Instead, it shows fields/settings related to the product only, on where it is supposed to show settings/fields related to FAQs Please check the screenshot for more details.
FAQ post type - hidden link
FAQ relationship - hidden link
FAQ details and product that related to FAQ - hidden link
Product connected to FAQ - hidden link
View loop settings - hidden link
It shows only the product-related setting - hidden link
Am I missing something?
Thanks
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
Hi Eric
I suspect the problem is that when editing the template for products, a particular product post is used for the preview (there is a selector at the top of the page), and perhaps that product doesn't have any child FAQs, so the View isn't finding any FAQ posts to iterate over in the output section. That is confusing the dynamic sources.
Choose a product for the preview that you are sure has child FAQ posts (or temporarily change the Content Selection for the View to show all FAQ posts, not just ones that are children of the current product).
Hello,
I have assign the FAQ for the preview and it's working now, But still it a bug, if the FAQ not present then it should not display the FAQ but there should be option for the dynamic content option for the current FAQ or child posts.
Hello,
I also need help with the another task, is it possible to create the temple that can show the relationship between two custom post types for example. I want to show the list of all the FAQ of the current product but not on the product detail page but in another template which show the product image, name and FAQs related to that product.
I found one more issue when I try to add image of the parent post ( Product ) in FAQ detail page which is also created using the template, I am not seeing any option to display the product image - hidden link
One more thing now the last issue regarding FAQ not showing in loop is resolved by adding the FAQ to currently previewed product, I have another query, now I want to show the another post ( FAQ answers ) related setting inside the loop of the FAQ in product detail page. but it's not showing the setting that belongs to FAQ answers. here FAQ answers is in relationship with the FAQ post type ( FAQ one - FAQ answers many )
To display one to many post relationship posts you will require a view.
Please check the following doc:
https://toolset.com/course-lesson/displaying-related-posts/#displaying-many-related-items
Hello,
Seem like you haven't read my message properly what I am asking is I want to create new layout on which I wanted to show post that is related to product but not on single page of the product. I want to create the new template for that on which I would just pass the product id or slug and all the FAQ related to product will be visible there.
Also please answer related to other queries too.
https://toolset.com/forums/topic/issue-regarding-the-display-custom-post-which-is-in-relationship-with-the-curre/#post-2176825
https://toolset.com/forums/topic/issue-regarding-the-display-custom-post-which-is-in-relationship-with-the-curre/#post-2176843
Do you mean you will create a new page where on that page you would like to display related post belongs to product and you will pass the product ID as URL param?
Yes, exactly also please check this too.
https://toolset.com/forums/topic/issue-regarding-the-display-custom-post-which-is-in-relationship-with-the-curre/#post-2176825
https://toolset.com/forums/topic/issue-regarding-the-display-custom-post-which-is-in-relationship-with-the-curre/#post-2176843
New threads created by Minesh and linked to this one are listed below:
https://toolset.com/forums/topic/split-display-product-image-where-product-is-set-as-parent/
Lets address the issue one by one.
So, what if you create a view and add a post relationship query filter and set this filter to filter by URL param and configure your view's loop output to display that filtered posts.
If you do not know how to do it, please share problem URL and admin access details.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
Lets fix the issue one by one. I'll split the ticket with your new questions. Lets fix the following issue first:
I am facing the issue regarding the display custom post FAQ answer, which is in relationship with FAQ ( FAQ - One to FAQ Answer - Many ) here ( FAQ also related to Product - One product to many FAQ ). Now, what I wanted to do is show the FAQ answer, which is related to the current FAQ in the view. Here view content is based on the FAQ that is related to the current product on the product detail page ( Template for Products D ). Now, when I try to use the heading block inside the view loop, I do not see any option showing the FAQ answer for the current FAQ. I want to show the title of the FAQ answer that is related to the current FAQ.
===>
So, the thing is that to display such post relationship we will require to use the nested views and you can not build nested views in block mode. To build nested view, you will require to use the legacy views.
I've created the following view that is used to display the FAQs belongs to product filter by post relationship:
Select posts in a Products FAQ relationship that are related to the Post where this View is shown.
=> hidden link
Then, I've created another view that is used to display the Answers belongs to FAQs and added the filter to filter by post relationship:
Select posts in a FAQs Answers Relationship relationship that are a related to the current post in the loop.
=> hidden link
Now, To display the related answers belongs to FAQ, I've added the view "answers-belongs-faq" within the "faq-belongs-product" view's loop editor:
<wpv-loop> <li> [wpv-post-link] </li> <div>[wpv-view name="answers-belongs-faq"]</div> </wpv-loop>
Then on your content template ( Template for Products D ), I've added the view "faq-belongs-product" using the "Fields and Text" block at the bottom of the content template:
[wpv-view name="faq-belongs-product"]
Now, If I visit a single product that has faqs and answers configured, I can see it displays the related FAQs belongs to product and related answers belongs to FAQ at bottom of the page:
=> hidden link
Can you please confirm this works as expected and this is what you wanted.
Yes, That's what I wanted but with the visual editor. That's alright we have decided to create custom short code for this as we have additional requirements.
Can you help us with this now - https://toolset.com/forums/topic/issue-regarding-the-display-custom-post-which-is-in-relationship-with-the-curre/#post-2178237
I want to display the all FAQ related to product but on different templet like where we can pass product id and that temaple can show all the related FAQs, Is it possible in block view ?
New threads created by Minesh and linked to this one are listed below:
I've split the ticket with your new question. You are welcome to close this ticket. I'll handle the remaining question with the split ticket.