I'm looking two days for the right answer but can't find it anywhere.

Here is my issue:

I'm using Drupal 7.21 with Entity Translation to build a multilangual site (English and Dutch). English is the default language. I have a vocabulary 'Sections' with the terms (lets say) Section 1, Section 2, Section 3, Section 4 and Section 5. Each term is translated to Dutch with the Entity Translation module.

I have also a content type 'Case', with a term reference field 'Section'. When I add a Case 'Case example' with section 'Section 1' the generated URL-alias will be 'section-1/cases/case-example'. When I translate 'Case example' to Dutch, the generated URL-alias will be 'section-1-du/cases/case-voorbeeld-1'.

The site contains five sections and each section contains its own cases.

I use Views (1 View, 1 Display) to display a case-overview per section. To achieve this, I've done these steps:

  • Add a contextual filter 'Content: Has taxonomy term ID'.
  • When the filter value is not available:

    • Provide default value
    • Type: Raw value from URL
    • Path component: 1
    • Check 'Use path alias'
  • When the filter value is available or a default is provided:

    • Check 'Specify validation criteria'
    • Validator: 'Taxonomy Term'
    • Check vocabulary 'Sections'
    • Filter value type: 'Term name converted to Term ID'
    • Check 'Transform dashes in URL to spaces in term name filter values'
    • Action to take if filter value does not validate: 'Hide view'

So here is my problem. If I look at the page 'section-1/cases' everything works fine. But when I look at the Dutch page 'section-1-du/cases', the view doesn't show anything.

My question: How is it possible to use a entity-translated term as contextual filter?

Any help will be appreciated!

  • Your 'Raw Value' changes with language. You should try Type Taxonomy term ID from URL. – Triskelion Mar 21 '13 at 16:14
  • Thank you for your answer Triskelion. But when I use 'Taxonomy term ID from URL' the view stays empty. I suppose I should use this option if the taxonomy term is the last component of the URL. Do you have any other suggestions? – Mark Mar 22 '13 at 7:44
  • There's some preliminary code for this in the feature request, in the Entity Translation issue queue. – colan Jul 9 '15 at 19:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.