i have an issue that is going to destroy my mind ... i am not a PHP developer so i can not find any way to solve it...
I am using K2 (v 2.6.2 updated from 2.5.7) for CCK (with alotof custom templates) and Joomfish (2.1.7) deployed on a Joomla 1.5.26 installation.
I was using the following code (in my templates) in order to fetch my individual k2 extra fields by name (K2 2.5.7):
$extraFld = array();
if ( $this->item->extra_fields ) {
foreach ( $this->item->extra_fields as $key=>$extraField ) {
$extraFld[ $extraField->name ] = $extraField->value;
}
}
and then i was fetching it like this:
echo "<li class=\"dinning-cuisine\"><span>" . JText::_('Cuisine') . "</span><br />" . $extraFld['Cuisine'] . "</li>
";
But since version 2.6.2 there is the option to directly fetch an extra field name & val:
$this->item-extraFields->ALIASNAME->name $this->item-extraFields->ALIASNAME->value
as described in K2 2.6.2 What is new documentation.
The problem is the following:
I have a bi-lingual site in Greek (default) and English locales.
I create an extra field in Default locale "Πεδίο 1" with alias name 'field1'
If i try to translate it the only option i have is to translate its name to lets say 'Extra Field 1' (different than its alias) ...
Then in my custom template if i try to fetch it like:
$this->item->extraFields->field1->value
only the Greek locale works. In English locale i receive a NULL value!
Any relevant experiences and solutions ?