【问题标题】:Magento wysiwyg editor insert variable in static block not workingMagento所见即所得编辑器在静态块中插入变量不起作用
【发布时间】:2014-11-12 00:59:35
【问题描述】:

当我在 CMS 中使用编辑器时,我尝试在显示和高编辑器状态下使用“插入变量”按钮并编辑 html 源代码。

我输入了<a href="{{config path='web/secure/base_url'}}/abc">Link to Base URL</a>

如果我的基本 url 是 http://example.com,它应该是 chagne http://example.com/abc, 但是它在前端向我显示了相同的<a href="{{config path='web/secure/base_url'}}/abc">Link to Base URL</a>,我怎样才能成功获取真实的URL。

附:我在“编辑html源”按钮中得到了类似的东西: <a href="http://example.com/index.php/admin/cms_wysiwyg/directive/___directive/e3tjb25maWcgcGF0aD0mcXVvdDt3ZWIvdW5zZWN1cmUvYmFzZV91cmwmcXVvdDt9fQ,,/key/68d29caa902f5d24dc08aa42aba1883e//denoate">Testing</a>,但在前端它仍然显示我回来<a href="{{config path='web/secure/base_url'}}/abc">Link to Base URL</a>

【问题讨论】:

    标签: magento variables insert editor wysiwyg


    【解决方案1】:

    尝试以这种方式在静态块中添加基本 url:

    <a href="{{store url='abc'}}">Link to Base URL</a>
    

    这应该会创建一个指向您商店的基本 URL 的链接。

    【讨论】:

    • 无论我添加什么变量,在我更新'edit html source'后,我看到它更改为&lt;a href="http://example.com/index.php/admin/cms_wysiwyg/directive/___directive/e3tzdG9yZSB1cmw9J2FiYyd9fQ,,/key/fb9e493a53fc7baa612f47073e5999b0/"&gt;Link to Base URL&lt;/a&gt;,但在前端它仍然以html代码显示为&lt;a href="{{store url='abc'}}"&gt;Link to Base URL&lt;/a&gt;
    • 刚刚搜索了一个解决方案,在模板中,我可以使用代码$_myHelper = Mage::helper('cms');$_processor = $_myHelper-&gt;getBlockTemplateProcessor();echo $_processor-&gt;filter($contentToBeConverted);来解决magento not convert variables问题,但我不想对所有块都这样做,我会找到一种可以自动完成的方法
    猜你喜欢
    • 2014-10-17
    • 1970-01-01
    • 1970-01-01
    • 2015-03-17
    • 2012-04-15
    • 2015-05-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多