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