Tell us what you are trying to do?
I am struggling to get parent/child taxonomy Views working. Here is a simplified example of structure of the parent/child hierarchy of Languages and their Levels I'm trying to achieve:
Title / slug
German / german
-- Native / 1-german-native
-- Fluent / 2-german-fluent
-- Intermediate / 3-german-intermediate
-- Basic / 4-german-basic
English / english
-- Native / 1-english-native
-- Fluent / 2-english-fluent
-- Intermediate / 3-english-intermediate
-- Basic / 4-english-basic
I understand that it is possible to create a View pulling only all the parent terms from the database. I believe I have this working. I created a View, "Languages View" and set the filter to "Select taxonomy terms whose parent is None". So far so good. 😉
My problem is getting my child list (ie the language levels). I created a second View, "Language Levels View" and set my child view to "Select taxonomy terms whose parent is set by the parent view", I'm still retrieving parent and child terms on the front end, where I would only expect to see for example "Native", "Fluent" items being returned from the database etc.
Hello. Thank you for contacting the Toolset support.
After reviewing the description you shared it almost look like you are just doing right things and it should display the related child terms with child view.
I need to check on your install whats going wrong there. Can you please share problem URL and wp-admin access details as well as what views you created.
*** Please make a FULL BACKUP of your database and website.***
I have set the next reply to private which means only you and I have access to it.
1) That looks better, however I am still technically unsure how the child View "Languages Level View" is filtering its results to parent View "Languages View". How does the child View "Languages Level View" know which View is its parent?
2) Also, I had to add the filter "Taxonomy is set by the current post" to the parent View "Languages View", so that only the languages for each Nanny are shown. Is that correct the correct way to do it? I think this is OK for the "Languages View" and "Language Levels View", since these are pulled into the Content Template "Template for Native Nannies".
3) Finally, I would like to also add these two fields as Search Controls in the left panel ("Native Nanny Search Controls View"), so that the first checkbox selection only shows the available languages, and the second control, a dropdown select box allows the user to pick a level per language.
How would you recommend to achieve this?
As you can see on the left hand side hidden link all the parents and children are still being pulled in if I pull in the language taxonomy...
1) That looks better, however I am still technically unsure how the child View "Languages Level View" is filtering its results to parent View "Languages View". How does the child View "Languages Level View" know which View is its parent?
===>
As you added the child view to parent view's loop output editor's content template (view's template) - that is why we know that we added X view (child) to Y view (parent)
2) Also, I had to add the filter "Taxonomy is set by the current post" to the parent View "Languages View", so that only the languages for each Nanny are shown. Is that correct the correct way to do it? I think this is OK for the "Languages View" and "Language Levels View", since these are pulled into the Content Template "Template for Native Nannies".
===>
Yes, thats correct.
3) Finally, I would like to also add these two fields as Search Controls in the left panel ("Native Nanny Search Controls View"), so that the first checkbox selection only shows the available languages, and the second control, a dropdown select box allows the user to pick a level per language.
===>
Do you mean you want to control what's displayed with your taxonomy filters - dropdown, having said that you want to display only options that are available as results? If yes:
Can you please check now: hidden link
I've changed the custom search settings to display filters for available options for each input as you can see with the following screenshot: hidden link
Thanks for the updates and apologies for the delay in getting back to you.. We have decided that we don't want to go for Language > Proficiency hierarchy because it is too complicated for users to understand.
Instead we would just like to use the list of languages twice, ie once as a list of possible "Native Languages" and once as "Other Languages Spoken". The list of languages would be the same in both cases.
In SQL I know this is an alias of the same physical table, but how is the best way to achieve this in Toolset/Wordpress?
Do we simply create two separate Views and reference the taxonomy twice or do we need to create two separate taxonomies, eg "Native Languages" and "Other Languages Spoken"?
Thanks for letting us know the best technical way to achieve this!
Do we simply create two separate Views and reference the taxonomy twice or do we need to create two separate taxonomies, eg "Native Languages" and "Other Languages Spoken"?
===>
Yes - you should create two separate taxonomies Native Languages" and "Other Languages Spoken" and two views to display it.