Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

View of nodes and their translations

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 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.

like image 275
infojunkie Avatar asked Mar 29 '10 04:03

infojunkie


2 Answers

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.

like image 116
infojunkie Avatar answered Sep 22 '22 15:09

infojunkie


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...

like image 25
Nikit Avatar answered Sep 26 '22 15:09

Nikit