Skip to main content
edited body
Source Link
milkovsky
  • 5.4k
  • 37
  • 59

I can suggest some "concepts" of solution with Views.

I didn't understood if you succeed to define target node language. (if no, write a comment, I'll update the answer).

Step1. You are able to pass arguments to the view that filters entityreference field. Then it's possible to add your language to the field views args programmatically in $field['settings']['handler_settings']['view']['args'];.

Step2. You can create custom contextual filter programmatically. Filter will pass the language id. This contextual will change View language using agrument value. you can change language in query alter - query() methidmethod of your child class of views_handler_argument.

Then just dpm($this) in the query() method and change language value to your argument.

I can suggest some "concepts" of solution with Views.

I didn't understood if you succeed to define target node language. (if no, write a comment, I'll update the answer).

Step1. You are able to pass arguments to the view that filters entityreference field. Then it's possible to add your language to the field views args programmatically in $field['settings']['handler_settings']['view']['args'];.

Step2. You can create custom contextual filter programmatically. Filter will pass the language id. This contextual will change View language using agrument value. you can change language in query alter - query() methid of your child class of views_handler_argument.

Then just dpm($this) in the query() method and change language value to your argument.

I can suggest some "concepts" of solution with Views.

I didn't understood if you succeed to define target node language. (if no, write a comment, I'll update the answer).

Step1. You are able to pass arguments to the view that filters entityreference field. Then it's possible to add your language to the field views args programmatically in $field['settings']['handler_settings']['view']['args'];.

Step2. You can create custom contextual filter programmatically. Filter will pass the language id. This contextual will change View language using agrument value. you can change language in query alter - query() method of your child class of views_handler_argument.

Then just dpm($this) in the query() method and change language value to your argument.

Source Link
milkovsky
  • 5.4k
  • 37
  • 59

I can suggest some "concepts" of solution with Views.

I didn't understood if you succeed to define target node language. (if no, write a comment, I'll update the answer).

Step1. You are able to pass arguments to the view that filters entityreference field. Then it's possible to add your language to the field views args programmatically in $field['settings']['handler_settings']['view']['args'];.

Step2. You can create custom contextual filter programmatically. Filter will pass the language id. This contextual will change View language using agrument value. you can change language in query alter - query() methid of your child class of views_handler_argument.

Then just dpm($this) in the query() method and change language value to your argument.