I am simplifying the loop through words in a given dictionary, the details of these words are both in the default language And one more thing is that the word-> Description-> is always returning the default language version, no matter which language is active, so I think I'm missing something here because I have guessed That this field comes from the active language version Adi will. Here's a code I'm using:
& lt ;? Php $ terms = taxonomy_get_tree (5); ($ Index = 0; $ index & lt; count ($ word); $ index ++) {? & Gt; ... & lt; Div class = "info" & gt; & Lt ;? Php echo trim_description ($ word [$ index] -> description, 10)? & Gt; & Lt; / Div & gt; & Lt; Div class = "more-info" & gt; & Lt; A href = "& lt ;? php print url (taxonomy_term_path ($ word [$ index])) ;? & Gt; More details & lt; / A & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt ;? Php}? & Gt; Edit to edit: My default language is not English, I'm Spanish by default and the other option is as english.
If you are using a module, you can use it to get translations of your words needed.
& lt ;? Php global $ language $ word = I18ntaxonomy_translate_terms (categorization _get_tree (5), $ language-> language); ($ Index = $; $ index & lt; count ($ word); $ index ++):? & Gt; & Lt; Div & gt; ... & lt; Div class = "info" & gt; & Lt ;? Php echo trim_description ($ word [$ index] -> description, 10)? & Gt; & Lt; / Div & gt; & Lt; Div class = "more-info" & gt; & Lt; A href = "& lt ;? php print url (taxonomy_term_path ($ word [$ index])) ;? & Gt; More details & lt; / A & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt ;? Php endfor ;? & Gt;
Comments
Post a Comment