Skip Navigation

[Resolved] Search Child posts return a table of child posts with parent post details

This support ticket is created 5 years, 4 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 4 replies, has 2 voices.

Last updated by Beda 5 years, 4 months ago.

Assisted by: Beda.

Author
Posts
#1308361

Hi,
I have child posts called complaint-use, and parent post called plant in a one to many relationship, I've also loaded the associations file.
I need a search box to enter medical complaint or use terms, and then to list in a table all complaint-use posts that contain any of the search terms with their parent plant names.
Please could you explain how to create the view for this.
Many Thanks
David

#1308563

Can I ask what is the "associations file" that you mention to have loaded?

In regard to the search, a search like that can be done easily by creating a View, where you list "complaint-use" posts.

Then you add a Search and Pagination filter, namely a "Text Filter".
This will produce a text input on the front end where you insert the View, and it'll allow searching by those terms both in the title and post body or only the title of the "complaint-use" posts.

Displaying these Posts Parents in the loop is quickly done by simply pressing the "Loop Wizard" and create your table with all fields needed.
When inserting fields, click on "Edit Field" to choose from what post (in this case from the parent) to display the fields from.

After this, you'll have a searchable list of child posts displaying as well parent (plant) post data.

We have more details here too:
https://toolset.com/documentation/customizing-sites-using-php/displaying-parent-posts/
https://toolset.com/documentation/user-guides/front-page-filters/

Please let me know if anything remains unclear.

#1309047

Hi Beda,
Almost missed this, wasn't expecting an answer over the weekend.
Thanks, much appreciated.
The associations file is the Toolset > Import > Associations that are created after uploading child posts with the _toolset_associations_relationship-slug field.
Thanks for explaining the steps, I'll give it a go and let you know if I succeed or need more help.

#1309375

Hi, I'm trying to follow your instructions for setting up a view - stuck on the 1st line:

Then you add a Search and Pagination filter, namely a "Text Filter".
When opening New View I selected: Display the results using a custom search
Is that correct?
Thanks
David

#1310263

That doesn't really matter, you can change it later, in the Screen options

However, I suggest going with the full custom display option, always. It's best to see what's possible, even if you don't use it, it won't make the views faster if it's hidden and ensures you always have all possible features open to using.