こんにちは皆さん、これはばかげているかもしれません。私が作成した変数にウィジェットを追加できるかどうか知りたいです。
{{translate fr='' en=''}}
これが変数です。静かでシンプルな管理者は、1 つの静的ブロックだけで複数の言語の静的ブロックを翻訳できます。これが私が必要としているものです。(言語ごとに複数の静的ブロックを行うことはできません)
今私の質問は次のとおりです:どうすればこれを行うことができますか:
{{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 '}}
À propos / 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;
}
どんな助けでも本当に感謝します
事前にthx!