Skip Navigation

[Resolved] View for custom post type

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

Our next available supporter will start replying to tickets in about 1.02 hours from now. Thank you for your understanding.

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 9 replies, has 2 voices.

Last updated by clayH-2 4 years, 5 months ago.

Assisted by: Minesh.

Author
Posts
#1667263
Screen Shot 2020-06-17 at 11.55.19 AM.png
Screen Shot 2020-06-17 at 11.52.48 AM.png

Tell us what you are trying to do?

- I am creating a site that is hierarchical in nature. The site will have main categories, then subcategories under the main categories. Each subcategory will have posts under each of them. So very top down, treelike structure.

- I created the custom post types for each level. I then created a taxonomy for each. I also created a one to many relationship for each level.

- I am now trying to create a view for each level, beginning with the top level main categories. I create the view following the instructions, but the block reports..."There were no posts found to display for this View's query." even though I have selected the main category in step three of the view wizard. It is this step that does not seem to take hold because when I go back into the block properties of the view, the content section does not have any selection.

- I selected the main category to have them display, but the Toolset block seems to be interfering with my ability to click the update button after making the selection. The update button is disabled and the only way I can interact with it is to remove the view block.

So I have the issue of nothing displaying and I cannot seem to update the page because the update button does not work when the view block is on the page.

Is there any documentation that you are following?

- https://toolset.com/lesson-placement/lesson-placements-1621261-1622283/

Is there a similar example that we can see?

- The examples are on my site.

What is the link to your site?

- hidden link

-----
Let me know if you need anything else.

#1667833

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please send me problem URL and access details so I can check whats going wrong with your site.

*** 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.

#1669621

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now: hidden link
- Please click on the Parts and it will display the associated sub-category and when you click on that subcategory, it will display the associated SOPs.

You need three views to display that structure. One view for your each post relationship level.

I've created the following view that displays the " SOP Categories"
=> hidden link

Then, i've created the following view that displays the "SOP Subcategories" and added the following view to the " SOP Categories" loop editor and added the query filter:

Filter by post relationship or repeatable fields group owner
Select posts in a SOP Categories SOP Subcategories relationship that are a related to the current post in the loop.

=> hidden link

Then, I've created another view that displays the related "SOPs" and added this following view to loop editor of "SOP Subcategories" and added the query filter:

Filter by post relationship or repeatable fields group owner
Select posts in a SOP Subcategories SOPs relationship that are a related to the current post in the loop.

=> hidden link

#1673885

Thank you very much. I had some followup questions...

1) Were you able to tell what I was doing incorrectly? I want to learn for the future.
2) Is there a way to edit a view after it is created?
3) Is it possible to have the action go to a separate page? For example, click on a category and it takes you to a page of subcategories. for the selected category.

Any KB docs would be appreciated.

#1674339

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

1) Were you able to tell what I was doing incorrectly? I want to learn for the future.
==>
The thing is that nested views are not supported yet with Toolset blocks that is why we need to create a view in classic mode and add the related post-relationship filter.

2) Is there a way to edit a view after it is created?
==>
Yes, You can see the list of the views with the following link and you can edit whatever view you want to edit:
- hidden link

3) Is it possible to have the action go to a separate page? For example, click on a category and it takes you to a page of subcategories. for the selected category.
==>
Yes, already see with your page that you added the sub-category view on single content template of post type "sop-categories".

More info:
=> https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-many-related-items

#1674851

"The thing is that nested views are not supported yet with Toolset blocks that is why we need to create a view in classic mode and add the related post-relationship filter."

- I wasn't attempting to create a nested view, but rather a workflow like you see that I have done...with each level on its own page. That is what I was having trouble getting done with blocks. Did I do it incorrectly or can that not be done with blocks?

#1675061

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Yes - you did it correctly for now.

You can also create a block view and add the block view to your separate view as you just did now and make sure you add the related post-relationship query filters.

So, Basically you should add block view on the following page and add query filter for post-relationship to display the related post of your post-relationship and select option ' Post where this View is shown."
- hidden link

#1675573

Can you please point me to where I can add pagination to a view? The only documentation I found was pertaining to blocks.

#1676365

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

To change you view to display results with pagination, you should change the view purpose from the screen options as shown with the following image: hidden link

And once you change the view's purpose you will see "Pagination and Sliders Settings" settings setting and you should check the following doc how you can add pagination to your classic views:

More info:
=> https://toolset.com/documentation/legacy-features/views-plugin/views-pagination/

#1678425

My issue is resolved now. Thank you!