0
votes

In our website on base of Drupal 7 we need to make a gallery of images that would show, at first, the categories of the galleries on the Gallery Page (in our case, "Groups", "Events", "Internships" etc.) and then, all the albums of the specific category (e.g. all the galleries of category "Events"). I solved this according to this Russian tutorial http://sherskova.ru/drupal/galereya-na-drupal-7-svoimi-rukami-views-panels-colorbox, where Colorbox, Views, Ctools and Panels modules are required. At first, I created a vocabulary in Taxonomy with the needed terms (categories of the galleries), then I created a content type "Gallery" with the corresponding fields: "Album" of type "term reference" to the corresponding vocabulary, "Gallery Description" of "long text" and "Gallery Images" of "Image" that would open in Colorbox. Then, I created two views: the first one for the output of gallery cover of each category --> all on one page, and the second one -- for the output of all the galleries of a particular category on one page.

This solution works apart from one problem: we need the gallery page to be presented in English and German languages. The found solution works however only in one language, so the German (original) version of the gallery page is shown both in German and English versions of the site.

For the translation we found the solution with Filter Criteria - Content:language, but it does not work for View of type "Term", which we have, because there is no such filter criteria.

Does anyone know how to translate Views of type "Term"? Or are there other ways to create galleries with the listed functionality that could be translated?

Thanks in advance!

1

1 Answers

0
votes

It might just be a quick fix but try this code: Found on this blog: http://smartwolverine.net/article/drupal-7-taxonomy-language-filter-absent-views#comment-17

It will do the job of a filter: "current language" for the specified view.

<?php function mymodule_views_query_alter(&$view, &$query) {    
if ($view->name == 'yourviewmachinename') {
    $query->where[] = array(
      'conditions' => array(array(
        'field' => 'taxonomy_term_data.language',
        'value' => array('***CURRENT_LANGUAGE***'),
        'operator' => 'in',
      )),
      'args' => array(),
      'type' => 'AND',
    );   } } ?>

It worked for me.