Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Magento 如何在静态块的变量中添加小部件_Magento_Static Block - Fatal编程技术网

Magento 如何在静态块的变量中添加小部件

Magento 如何在静态块的变量中添加小部件,magento,static-block,Magento,Static Block,大家好,这可能很傻,我想知道是否有可能在我制作的变量中添加一个小部件 {{translate fr='' en=''}} 这就是变量。安静简单的管理员可以翻译静态块与多种语言在只有一个静态块,这是我需要的。(我不能为每种语言执行多个静态块) 现在我的问题是:我如何做到这一点: {{translate fr='{{widget type="catalog/category_widget_link" anchor_text="À propos" title="À propos" template=

大家好,这可能很傻,我想知道是否有可能在我制作的变量中添加一个小部件

{{translate fr='' en=''}}
这就是变量。安静简单的管理员可以翻译静态块与多种语言在只有一个静态块,这是我需要的。(我不能为每种语言执行多个静态块)

现在我的问题是:我如何做到这一点:

{{translate fr='{{widget type="catalog/category_widget_link" anchor_text="À propos" title="À propos" template="catalog/category/widget/link/link_block.phtml" id_path="category/9"}}' en='{{widget type="catalog/category_widget_link" anchor_text="About us" title="About us" template="catalog/category/widget/link/link_block.phtml" id_path="category/9"}}'}}
正如你所看到的,我正试图做的是翻译小部件。但是它被{{}弄糊涂了。最后,我得出以下结论:

{{widget type="catalog/category_widget_link" anchor_text="À propos" title="À propos" template="catalog/category/widget/link/link_block.phtml" id_path="category/9"' en='About us '}}
以我们的观点而不是建议

这是
translate
功能:

public function translateDirective($construction)
{

    $params = $this->_getIncludeParameters($construction[2]);
    Mage::log(print_r($params, 1), null, 'logfile.log');
    if($store_code = Mage::app()->getStore()->getCode() == 'default' || $store_code = Mage::app()->getStore()->getCode() == 'english_canada') $words = $params['en'];
    else if($store_code = Mage::app()->getStore()->getCode() == 'french') $words = $params['fr'];

    //return $words;
    return $words;

} 
任何帮助都将不胜感激


提前谢谢

好的,所以我找到了一个适合我的工作,而不是使用小部件链接类别/页面,我会使用链接。它的用户友好性稍差,但我可以这样处理:

<li><a title="{{translate en="Term & Conditions" fr="Terme & Conditions"}}" href="{{store url="customer-service"}}">{{translate en="Term &amp; Conditions" fr="Terme &amp; Conditions"}}</a></li>