开发者

View of nodes and their translations

开发者 https://www.devze.com 2022-12-25 02:56 出处:网络
I\'m trying to create a view of nodes and their translations. Specifically, I want each row to show the node title for each language.

I'm trying to create a view of nodes and their translations. Specifically, I want each row to show the node title for each language.

The way I'm doing it right开发者_StackOverflow now is by filtering the view by a specific language, then adding one relationship of type "Node translation: Translations" for each language on the site. I can then choose the "Node: Title" field, once for the original language and once per relationship.

The problem with this approach is that the nodes that don't exist in the filtered language, but exist in other languages, are not included in the view. That's what I need help with.


I finally got around to solving this (on Drupal 7).

The idea is to filter the view by Content translation: Source translation, then adding one Content translation: Translations relationship for each language.

In addition, a special join handler is used to handle nodes that have no translations. The handler code is on GitHub.

I've created a demo of this approach.


One of way: Just do it without relationships, but use sorting via "Node translation: Translation set node ID", so you get ordered list of nodes, there translated versions of node will followed one by one...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号