Hi,
I have 2 CPT (tender & tender-technical) and I created one archive for those.
How can I show all posts from these CPT "merging" the records in the same page?
update: if I understood correctly I need nested view but nested view isn't supported yet in Toolset Blocks. I works with Blocks now, it is easy (and necessary?) to convert my work to classic Toolset Views? Is there any other solution to achieve this?
Any help would appreciated,
George
Hi George,
Thank you for getting in touch.
If I understand correctly you want to include another post type in your custom post type archive ?
For e.g if you're viewing the archive for tender then you want to show the tender-technical posts as well on this archive ?
Are these post types related through a post relationship ?
Please let me know.
Thanks,
Shane
Hi,
I want to show/display combined all the posts from 2 different cpt in 1 archive page.
No there is no relationship but they use the same taxonomy and custom fields and layout.
Hello,
In a case like this you will create the archive page as normal and then below the archive's view block you will create another view block that will list out the posts from the other post type that you want to display.
This should allow you to display both post types on the same archive.
Thanks,
Shane
Hi Shane,
I managed to create a common archive and the posts are showing up from both CPT.
Now the post are showing but they are not combined and sorted by post date.
How can I achive this? Please note that I using the legacy Toolset View.
Also, how can I add a search field to search in the posts?
Shane: your last answer is not showing in the ticket history but only in the email i received.
Hello,
The only way I see working around this is when you create the archive, you do not use the archive loop, essentially leaving that empty.
Now on the view that is created on the archive you will select both post types to be displayed by the view, then they should be combined.
Please let me know if after doing this if everything is ok now.
Thanks,
Shane
Hi,
Something is going on with the loop:
the page is looping the same first 10 post (along with the search box) 10 times in the first page and in every page looping again 10 times the next posts.
How can I loop only once in every page?
George
Hello,
Would you mind allowing me to have admin access to the website so that I can have a more detailed look at this for you ?
Please where applicable please provide me with a link to an example page where I can see the issue.
I've enabled the private fields for your next response.
Thanks,
Shane
Hello,
The problem was that you added the view inside the archive loop block. You should've added it outside this like below.
lien caché
Now all you need to do is to add the pagination to the view itself rather than the archive.
lien caché
Thanks,
Shane
Thank you for the fix!!
I saw your archive block-editor page where you build the loop but I'm checking the "All Tenders" view and can't see any difference. I'm still seeing the "loop-item-in-all-tenders" in Avada builder, I'm still seeing the same filter and navigation options.
So I don't need this View (All Tenders) at all?
Everything created in the archive page?
Can I re-enable the Toolset Blocks and disable the Views or should I keep the Views in order to combine 2 CPT in 1 view?
Hello,
I saw your archive block-editor page where you build the loop but I'm checking the "All Tenders" view and can't see any difference.
There is a difference, previously you inserted your view inside the archive loop. However I removed the view from the archive loop and placed it outside of the archive loop. If you look at the block navigation menu you will see it being depicted.
So I don't need this View (All Tenders) at all?
The view is still needed because it is being used to display the custom data for your archive.
Can I re-enable the Toolset Blocks and disable the Views or should I keep the Views in order to combine 2 CPT in 1 view?
Views and Blocks are the same plugins. Essentially blocks is views renamed and with the Block editor for views enabled by default. So if you have the Toolset Blocks plugin enabled then you won't need the Views plugin as they are the same.
Thanks,
Shane
My issue is resolved now. Thank you!
Hi,
Today I opened the archive page that you fixed but the problem with the "looping the same items" remain in every page when I change page by the navigation. All the same items showing up again and again.
Can you please check the archive page again and advise how can I fix this?
Hello,
Can you provide the login details again ? They are automatically removed when the ticket is marked as resolved.
Thanks,
Shane