![]() |
How to call a language variable
Hi there,
I have a text that comes back in a lot of products pages. So, my idea is to insert that text in a language variable. Problem is how to call the variable from txt_welcome, from category description and from product description ? I have tested from txt-welcome but the variable itself is interpreted as text... So, how to call it ?...i've not found in my research in the forums. Thanks. |
Re: How to call a language variable
{$lng.your_variable}. But you can't have language variable inside language variable
|
Re: How to call a language variable
Steve,
Before creating my own language variable, i tried again to test with an existing one but it doesn't work. I tried to put the following both in category description and in product description but it is still treated as text : {$lng.disable_chinfo_msg} {$lng.txt_disable_chinfo_msg} {literal} {$lng.txt_disable_chinfo_msg} {/literal} {{$lng.txt_disable_chinfo_msg}} Those 4 attempts above did not displayed the text contained but only the variable itself. I have a doubt as if the variable could not be found it should maybe give back an error but not display the variable itselfs logically. I have both french and english languages installed with english currently disabled, the variable is called from the french language version. Is the path to the variable wrong ? |
Re: How to call a language variable
You also cannot have smarty tags inside descriptions (they are treated as plain text) or if you insist of doing it you have to call the decsription with "eval" function in the template so the smarty tags are resolved - http://www.smarty.net/docs/en/language.function.eval.tpl
|
Re: How to call a language variable
Technically, should I be able to use {$lng.lbl_myLabel} inside the includes/help.php file. It not working correctly when placed there.
|
Re: How to call a language variable
This is smarty code which cannot be used in PHP script directly.
You should use the following PHP code instead: PHP Code:
|
All times are GMT -8. The time now is 09:26 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.