Skip Navigation

[Resolved] Post Title, Post relationships, Taxonomies

This support ticket is created 6 years, 9 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Author
Posts
#614967

Hi,

I'm creating a website for medicinal plants and their uses, all the information is currently on Excel sheets. I'll be using the CSV Importer plugin to import the data into 2 custom post types.

1. Plant-Species is the Parent Post
2. Complaints-Treated are the child posts
for each plant species there are 1 or more complaints treated.
for each post in plant-species and complaint-treated there is a unique name and id number,

Plant-Species - (Parent Post).
* Plant name----------Post Title
Plant ID-------------Number
Family plain---------text single line
* English Name(s)----Select
* Arabic Name(s)-----Select
* Hebrew Name(s)----Select
Plant Image(s)------Image
All other fields-------single or multi-line text

Complaints-Treated - (Child Post)
* Complaint Treated-----Post title
Plant ID-------------------Number
Complaint ID------------Number
* System Effected--------single line text
* symptom(s)-------------Select
* Medicinal action(s)---Select
Preparation-------------multi-line text
Administration----------multi-line text
plant part(s) used------Select
All other fields----------single or multi-line text

* All these fields need to be searched for any terms entered in the search box and return the posts identified

I have a couple of questions:

1. Does the post title also need to appear as a separate single line field - or will the post title be included in searchs?

2. Is it advisable to define any fields as flat or hierarchical taxonomies, categories or tags - if so which?

Thanks for your help
David

#615184

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi David

If you are creating a View to filter/search posts then the text search filter will search the post title and (optionally) the post body. If you also want to include custom fields in text searches, you would need to add the Relevanssi plugin (https://toolset.com/documentation/user-guides/searching-texts-custom-fields-views-relevanssi/).

For your fields you have several select boxes. Some of those might be a good option to use taxonomies rather than custom fields, if you intend for your users to be able to filter by them. Taxonomy queries are more efficient than post meta queries.

I don't think that applies to the name of the parent post in different languages, but may apply to the select fields of the child post (e.g. users may want to filter by symptoms treated).

One thing to consider that you haven't mentioned is connecting the imported parent and child posts.

If you don't do anything special to handle this during the import then you will need to connect all of the posts manually in the admin pages.

The only option I know for setting up the post relationships during import is to use the WP All Import plugin and add a custom function so set the relevant field on the child post (i.e. "_wpcf_belongs_plant-species_id"). You can read about how another client solved this here: https://toolset.com/forums/topic/automatically-linking-child-posts-during-wp-allimport-pro/

#615797

Thanks very much Nigel for your detailed answer - just what I was looking for, I will use your suggestions when uploading the data to the website.
I'll get back to you if I have any more questions

Thanks
David