0

I have my content type set up something like this:

type (select):
  type1
  type2

taxonomy_term_reference (select):
  term1
  term2
  term3
  term4
  term5
  term6

When a user fills out my node and chooses type: type1, I want only these terms to show up as options:

  term1
  term4
  term5

When a user fills out a my node and chooses type: type2, I want only these therms to show up as options:

  term2
  term3
  term6

Is there any good way of doing this? The only way I can think of is with custom code via hook_form_alter()?

0

Try reference-option-limit module. It has the ability to limit your reference field value.

Another approach is to use entity reference instead of term reference and add an entity reference display to a views and select what items you'd like. Then in your content type reference field setting and under entity selection select the views you just created.

I hope this will help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.