[Closed] How to set grand child posts custom search?

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.

This topic contains 28 replies, has 3 voices.

Last updated by Minesh 1 month, 1 week ago.

Assigned support staff: Minesh.

Author
Posts
#1568681

Tell us what you are trying to do?
I have the standard WP Post type that has a relationship with Comuni CPT (parent post) that has a relationship with Province CPT (grand parent post) that has a relationship with Regioni CPT (grand grand parent post) that has a relationship with Nazioni CPT (grand grand grand parent post).
Well, in every parent posts I need to display all related Standard WP Posts with custom search and map.

Well, I have created the View and Content Template of the parent Comuni CPT and it works fine but it is very slow to show the map: hidden link
But I don't know to create the grand parent, grand grand parent and grand grand grand parent Views and Content Templates.
I have tried to create the grand parent View and Content Template, but it don't display any results...: hidden link

Is there any documentation that you are following?
I don't know and I don't have found it.

Is there a similar example that we can see?
I don't know.

What is the link to your site?
See the links before.

#1568955

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

First of all, let's divide your issue into smaller tasks.

As I understand, You have following relationship:
=> Nazioni => Regioni => Province => Comuni => Post
Where:
- Nazioni is the top most parent post type and Post is child most post type.

you want to display (grand grand grand parent post) where? To the lowest child-level, having said that to the default post type post's single post page?

#1569387

As I understand, You have following relationship:
=> Nazioni => Regioni => Province => Comuni => Post
Where:
- Nazioni is the top most parent post type and Post is child most post type.

Yes

And, I want to display the Custom Search Posts with Map inside all Parent.
So, inside the Comuni I have displayed the Custom Search Posts with Map to display all Posts related to Comuni
Inside the Province I need to display the Custom Search Posts with Map for all Posts related to Comuni that are related to Province.
Inside the Regioni I need to display the Custom Search Posts with Map for all Posts related to Comuni that are related to Province that are related to Regioni.
Inside Nazioni I need to display the Custom Search Posts with Map for all Posts related to Comuni that are related to Province that are related to Regioni that are related to Nazioni.

#1569423

Minesh
Supporter

Languages: English (English )

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

Maybe you are using the term Custom Search wrongly or I need to understand the your usecase first.

do you want to add custom search view to all your post types? or you just wanted to display the related posts?

So, inside the Comuni I have displayed the Custom Search Posts with Map to display all Posts related to Comuni
==>
Do you mean on single post page of Comuni post type, you have added the custom search view that displays the related posts of post type post?

Inside the Province I need to display the Custom Search Posts with Map for all Posts related to Comuni that are related to Province.
==>
do you mean with single post page of post type Province you just wanted to display related posts (the child post posts of post type post)?

Inside the Regioni I need to display the Custom Search Posts with Map for all Posts related to Comuni that are related to Province that are related to Regioni.
==>
do you mean with single post page of post type Regioni you just wanted to display related posts (the child post posts of post type post)

Inside Nazioni I need to display the Custom Search Posts with Map for all Posts related to Comuni that are related to Province that are related to Regioni that are related to Nazioni.
==>
do you mean with single post page of post type Nazioni you just wanted to display related posts (the child post posts of post type post)

#1569463

Do you mean on single post page of Comuni post type, you have added the custom search view that displays the related posts of post type post?
Yes, see the link (I don't know why the map need more time to load, over 30sec): hidden link

do you mean with single post page of post type Province you just wanted to display related posts (the child post posts of post type post)?
Yes, I mean that. And I want to display the child post posts of post type post Custom Search with map. Like this hidden link

do you mean with single post page of post type Regioni you just wanted to display related posts (the child post posts of post type post)
Yes, I mean that. And I want to display the child post posts of post type post Custom Search with map. Like this hidden link

do you mean with single post page of post type Nazioni you just wanted to display related posts (the child post posts of post type post)
Yes, I mean that. And I want to display the child post posts of post type post Custom Search with map. Like this hidden link

#1569513

Minesh
Supporter

Languages: English (English )

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

I check the page you shared: hidden link

It seeems you want to have one view to filter all your posts for all post types which is in relationship - correct? If yes:
- The way to filter the posts by post relationship and display the related posts is by adding the post-relationship fronted filter.

Please check the following related doc:
=> The post-relationship search filters work in form of a select type field, as explained in this guide:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/how-to-filter-posts-by-their-ancestors/

Is this information are looking for?

#1569675

Hi Minesh.
I don't need the front end relationship filter ancestor to display the related child post posts type posts.
Because Nazioni, Regioni, Province and Comuni posts are geolocated by map filed, and the post type posts are related to Comuni posts.
When a user open a Nazioni, Regioni, Province and Comuni post, inside on the post he need to find all post type posts related, and a custom filter whith text filter, post type category and date filed. And also, display the map with posts type posts marker

#1570525

Minesh
Supporter

Languages: English (English )

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

Do you mean that on single post pages of post types Nazioni, Regioni, Province and Comuni , you added the custom search like this page? hidden link

The problem is I just wanted to know you just wanted to list (display) the related posts of default post type post which is the lowest most posts in your relationship or you also want to add custom search? If you want to add the custom search, is custom search will be added to all post types (Nazioni, Regioni, Province and Comuni) single post pages? If yes: what fields and information you want display with that?

If you can share access details that will also be helpful to me to understand your relationship structure. Please share as much information as you can, and if will be great if you can share a test case example of your expected results with a specific problem uRK that will help me to guide you in the right direction.

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

#1570653

I have lost to write that in the single item results is display also the name of the Comuni post where the Post Type post is located.

#1570661

Minesh
Supporter

Languages: English (English )

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

First of all, let me tell you how a custom search works.

The custom search will work to the post type you set your view to query. Having said that let's take the example of the following page:
=> hidden link

with the above page, you added the following view:
=> hidden link
Now, as you can see with the above view, the view is set to Query the post type "Comuni". The post type "Comuni" posts have only one custom field assigned that is called "Mappa".

I see with the view you created:
=> hidden link
- You added the frontend filters like category and data-inizio but that taxonomy category and the custom field data-inizio is not a part of the post type "Comuni" to which you set the view to query.

Again, as I said, you can only add frontend filters to your view for the taxonomy/custom fields which are attached to your post type to which your view is set to query.

So, Basically, you can not filter view using another post type custom fields. Can you please make sure you understand what I said.

#1570817

Yes, I have understood.
I have opened this ticket to ask if there is a way to use the Post Type posts Custom Search in grand parent Province, Regioni and Nazioni.
Because, for now, I don't know if there is a way and I don't have found any guides...

Can I only display a Post Type posts list without custom search in grand parent Province, Regioni and Nazioni?
If yes, it is a very big limit of Toolset.

#1570825

Minesh
Supporter

Languages: English (English )

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

I have opened this ticket to ask if there is a way to use the Post Type posts Custom Search in grand parent Province, Regioni and Nazioni.
Because, for now, I don't know if there is a way and I don't have found any guides...
==>
I'm afraid, its not possible to filter the view using frontend filter of parent/grand parent custom fields as to switch to each post-relationship level, you need a separate view with a post-relationship query filter. We called it nested views.

Can I only display a Post Type posts list without custom search in grand parent Province, Regioni and Nazioni?
If yes, it is a very big limit of Toolset.
==>
Yes, if you only want to display the related posts, its possible using nested views.

This is how it works and I'm afraid there is no such native feature available to filter the views with parent post custom fields. What I can do is, you can file a feature request that will allow you to raise your voice in front of our product manager:
=> https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

#1570927

Ok, thank you Minesh.
So, I think that I will do that:
In every parent Nazioni, Regioni e Province, I will display the list of every child posts (ex: In Nazioni I will display the list of Regioni, in Regioni, the list of Province, and in Province the list of Comuni, and in Comuni the list of post type posts with custom search and Map).

Also, In Nazioni, Regioni, and Province I will create a section to display the posts that have the Date custom Field >= of Today. And then I want to ask: is it possible to display here a map with the marker of the child post type posts?

And I will create a new page where I will add the Custom search like as explained in this guide: https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/how-to-filter-posts-by-their-ancestors/
And I will create another new page where I filter the post type posts by distance (but I don't know if it is possible using the parent and grand parent address fields).

#1571799

Minesh
Supporter

Languages: English (English )

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

In every parent Nazioni, Regioni e Province, I will display the list of every child posts (ex: In Nazioni I will display the list of Regioni, in Regioni, the list of Province, and in Province the list of Comuni, and in Comuni the list of post type posts with custom search and Map).
==>
Ok - to display the child post is possible but I'm not sure yet how exactly you are going to share example. With Comuni post type again its a parent post type, so what fields you are going to add to the custom search?

Also, In Nazioni, Regioni, and Province I will create a section to display the posts that have the Date custom Field >= of Today. And then I want to ask: is it possible to display here a map with the marker of the child post type posts?
==>
Yes, you can display a map but still I'm not sure how you are going to display the information.

And I will create a new page where I will add the Custom search like as explained in this guide: https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/how-to-filter-posts-by-their-ancestors/
And I will create another new page where I filter the post type posts by distance (but I don't know if it is possible using the parent and grand parent address fields).
==>
You simply need to understand that you can not filter the view that is created to display child posts by parent/grand-parrent post fields. Its simply not possible.

Maybe rather having create all views at a time, you should try to create a test example by selecting one of the post type and start the process.

#1578027

Hi Minesh,
I have some changes in the Province CPT Content Template.
Now I display a map with markers of Comuni CPT (but I think there is a bug because the Comuni CPT posts are 97 but the marker aggregator number count 113 Comuni CPT posts).
Also, a list with all Comuni CPT posts (that are 97).

After I display all Grand Child Post Type posts with pagination, and for every page I display 9 posts but, sometimes I display 3 posts, sometimes 1 post, sometimes 0 posts in pagination.

What is wrong and what should I do to solve the issues?
hidden link

New threads created by Luo Yang and linked to this one are listed below:

https://toolset.com/forums/topic/split-how-to-set-grand-child-posts-custom-search/

The topic ‘[Closed] How to set grand child posts custom search?’ is closed to new replies.