Needs review
Project:
Jump
Version:
6.x-2.x-dev
Component:
Miscellaneous
Priority:
Minor
Category:
Task
Assigned:
Reporter:
Created:
1 Mar 2010 at 09:34 UTC
Updated:
22 Jun 2011 at 13:29 UTC
A client has a vocabulary containing various topics in two languages. Most of the terms are assigned to one of two languages but since there are topic which spell the same in both languages there are also language neutral terms. In order to just display terms of current language (or neutral ones) I changed one function in the module:
function jump_menu_get_taxo_options(&$options, $vid) {
$tree = taxonomy_get_tree($vid);
global $language;
$lang = $language->language;
foreach ($tree as $term) {
if ( $term->language == $lang || $term->language == '' ) {
$options[taxonomy_term_path($term)] = $term->name;
}
}
}
Best,
Paul
Comments
Comment #1
nicholas.alipaz commentedThis feature didn't get into 1.x. We are glad to accept a new patch against 2.x branch.
Comment #2
dmirtillo commentedThat function is identical in the 2.x branch, so no need for a new patch.
Also: the metod posted by Paul.B only works for mixed language vocabs that do not contain translatable terms (each term has a fixed language).
I am working with vocabularies that have translatable terms, so i had to adjust the function like this: