Skip to main content

Composition of goods in the product slider...

More
12 years 3 months ago - 12 years 3 months ago #160836 by neviqimka
Sorry but, I don't understand what you mean. I just replace my code on your and now in slider description displayed all products, but without using override language. Slider displayed only language constants and without commas - STRAWBERRY ANANAS APPLE
Last edit: 12 years 3 months ago by neviqimka.

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago #160882 by nicolas
Hi,

If you want to have the translation for multiple selections, it gets more complex.
Such code should work:
$values = explode(',',$this->row->bcompound);
foreach($values as $v) echo JText::_($v);

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago - 12 years 3 months ago #161115 by neviqimka
Thank you for help, but it's all a little complicated... in my case I must to create 3 custom fields + language constants + change the code which does not gives flexible description. Tell me what you think about my decision - I created one custom field which has text type and added the code in show_block_custom_main.php:
Code:
$array = array( 'STRAWBERRY' => '<a href="strawberry.jpg">strawberry</a>', 'ANANAS' => '<a href="ananas.jpg">ananas</a>', 'APPLE' => '<a href="apple.jpg">apple</a>'); $description = str_replace(array_keys($array), $array, $this->fieldsClass->show($oneExtraField,$value)); echo $description;
Last edit: 12 years 3 months ago by neviqimka.

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago #161380 by Xavier
Hi,

Yes this solution is correct too. The one given by Nicolas is not so complicated, you just have to use his code:
Code:
$values = explode(',',$this->row->bcompound); foreach($values as $v) echo JText::_($v);

And the translations should be displayed.

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago #161520 by neviqimka
Thank you and Nicolas for help ;)

Please Log in or Create an account to join the conversation.

Time to create page: 0.182 seconds
Powered by Kunena Forum