1

I have three content types, two of them have an entity reference field referencing the others in some hierarchical manner, that explained as follow:

  -----------------------------------------------------------------------------------
  | content type | Country   | State                | City                          |
  -----------------------------------------------------------------------------------
  | reference    | none      | reference to Country | reference to Country and State|
  -----------------------------------------------------------------------------------

Normally, while adding content for City, both entity reference fields will show all its contents as values.

So, how to limit values in second entity reference field (State) to only values based of each choice of first reference field (Country)?

I assume Conditional Fields can do that, but I had no chance to figure it out.

  • I don't have an answer to question, per se, but it seems like this might be better built into a taxonomy reference; the hierarchy is built in (i.e. city can have an automatic County/State by its position in the hierarchy) & you can use one of the many display widgets modules for filtering through grouped categories (e.g. Hierarchical Select module). – Shawn Conn Sep 12 '16 at 18:39
  • While using taxonomy in this particular case is more practical I know, but there were other considerations to use content types instead. – Kareem Sep 22 '16 at 19:32

Your Answer

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

Browse other questions tagged or ask your own question.