Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi, I tried many times, but the module still not work.
Suppose there are three content types, articles, cities and countries.
1. cities have a entity reference field which referred to countries node type.
2. countries do not have entity reference.
3. articles have two entity reference fields, one is referring to cities, another is referring to countries.
I tried to enable the "Limit this field's options according to matching field values" in these three entity reference fields,
but there is only one "body" matching field there.
How could I make this module work? Thanks.
Comments
Comment #1
joachim CreditAttribution: joachim commented> a entity reference field which referred to countries node type
> another is referring to countries
These two things must be the ***SAME FIELD***. Have you set that up properly?
(This is clearly stated in the docs, I think. If not, please suggest how to improve them!)
Comment #2
Micha1111 CreditAttribution: Micha1111 commentedSo steps for right configuration are:
1. Create contenttype "countries"
2. Create some nodes of contenttype countries
3. Create contenttype "cities" with an entity reference field to contenttype countries (i.e. "inCountry" - List widget)
To check "Limit this field's options according to matching field values" is not nessesary
4. Create some nodes of contenttype cities
5. Create contenttype "locations" (or something else) with two entity reference fields:
At first: Entity reference field to contenttype countries (chose => add an existing field !! => "inCountry" !! - List widget)
To check "Limit this field's options according to matching field values" is not nessesary
Second field: Entity reference field to contenttype cities (chose => add new field !! => i.e. "inCity" !! - List widget)
Now check "Limit this field's options according to matching field values" => now field "inCountry" is available !!
6. Create nodes of contenttype locations
If you click on an evailable country in field "inCountry" an ajax operation for limitation of available cities in field "inCities" will start.
Perhaps, this is an improvment of your docs ?
Comment #3
efarseer CreditAttribution: efarseer commentedThis guideline really help me make this module work now! Thanks!!!
Comment #4
GBain22 CreditAttribution: GBain22 commented#2 was great information - finally got it working
Comment #5
legolasboMarking this issue fixed.