What I want to do?
I want to display all categories in first drop down and in second all titles of related nodes with the selected category.
To get that I have mentioned all the tasks I have done. Please read below.
Created taxonomy named category
with terms listed Laptop
, Car
, Mobile
etc.
Content type named product
with fields title
, description
, category
etc. The category
field uses term reference of category
taxonomy.
category
and product
as drop downcategories
drop down field, displayed all categories (Laptop, Car, Mobile) by using WebForm Term Options.product
drop down field is empty yet.I have used hook_form_FORM_ID_alter() hook to alter the webForm I created. I have found the solution to get all the nodes pragmatically those are related with specific taxonomy term ID.
My first question is how to display all these nodes' titles in existing drop down field?
Another question is on category
change, products
must be change according to its nodes like ajax?
I asked the same question on Drupal Stack Exchange. Here is the solution https://drupal.stackexchange.com/questions/225840/how-to-programmatically-get-all-nodes-which-are-related-to-the-specific-term-id/225855?noredirect=1#225855