1

I'm using Drupal 7, i18n, Views3, translated_entityreference, and Entity Translation.

http://lingtransoft.info/apps/paratext

I have a content type: Training Resource, and each Training Resource is a member of another content type that is connected connected by Entity Reference (field_translation_ref) to the content type Application.

If I add Training Resources in English and choose the application Paratext, they get tagged to node 174, the Original content. If I add a Training Resource in French and Choose the application Paratext, it gets connected to node 399985, the nid of the French translation of the Paratext content.

The following View allows me to see all Training Resources tagged to Paratext(174).

View Config

Output

I know that the "Content Translation: Source Translation" Relationship is supposed to give me access to the source node, and "Content: Entity translation: translations" has the potential to allow access to the translated node, but I can't figure out how to configure the view to use these values.

What I want:

Now I would like a view that dynamically aggregates and displays the resources tagged to both Paratext(714) [The Translation Source] and Paratext(399985) [the translated node].

On the English Application page: Show All Training Resources with Entity Reference to the current NID and also those connected to the Entity translation of this page in French.

On the French page: Show All training Resources with entity reference to the current NID, and also those connected with the source Translation.

If possible, I would prefer to use the interface and/or some existing modules to do this.

Thanks for any help you can give me. ~Matthew

1 Answer 1

0

The problem isn't getting both the source and translation nodes into Views results, that's easily done.

The problem is when you apply the Contextual filter. Because the plain Entity reference field Contextual filter isn't translation aware.

But you can make it aware of translations with the help of the Relationship Content translation: Translations.

I don't know if your filter for Media to be in English will cause any trouble, so try to remove it if you see any problems.

Also as far as I can see you don't need the Entity Reference: Application Ref Relationship, you're not using it in any of the Fields and unless you need it for something not visible here you can safely remove it.

List nodes referencing a node, along with nodes referencing its translations

Here are the steps you need to do on your Views to make it Contextually sensitive to not only the referenced entity, but also to that entity's translations:

  1. You already have Training materials views showing some fields.

    Don't include any language filters, unless you plan on allowing all the languages which defeats the filter's purpose anyway.

  2. Add the Content translation: Translations Relationship and configure it:
    Don't Require it (although I haven't noticed any difference)
    Translation option: All
  3. Add the Content: Application Ref Contextual filter and configure it:
    Use the Translation Relationship!
    When the filter value is NOT in the URL
    [whatever you like, All results or Default Content ID from URL]
    When the filter value IS in the URL or a default is provided
    Specify validation criteria
    Content
    Application
    Node ID

Now if you enter an Application node ID of any language, you will see all Training nodes referencing it AND all Training nodes referencing translations of the Application node.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.