Magento静态块javascript变量

Magento静态块javascript变量,javascript,magento,variables,Javascript,Magento,Variables,我已经学习Magento一周了,我一直在学习Magento静态块。我正在用静态块内容编写一些代码。用线条: "Testing Magento variables {{config path="general/store_information/name"}}" 我很清楚我的店名。我的问题是,我曾多次尝试将该变量分配给javascriptgreeting变量,但总是失败。也许有人能帮我写些什么,而不是?。我将用它来表示if-else语句 <html> <body> "T

我已经学习Magento一周了,我一直在学习Magento静态块。我正在用静态块内容编写一些代码。用线条:

"Testing Magento variables {{config path="general/store_information/name"}}"
我很清楚我的店名。我的问题是,我曾多次尝试将该变量分配给javascriptgreeting变量,但总是失败。也许有人能帮我写些什么,而不是。我将用它来表示if-else语句

<html>
<body>

"Testing Magento variables {{config path="general/store_information/name"}}"

<button onclick="myFunction()">Try it</button>

<script>
function myFunction() 
   {
      var greeting = ??????????;

   }
</script>


</body>
</html>

测试Magento变量{{config path=“general/store_information/name”}
试试看
函数myFunction()
{
变量问候语=??????????;
}

不确定,但请尝试包装文本

测试Magento变量{{config path=“general/store_information/name”}

作为

"Testing Magento variables <span id="name">{{config path="general/store_information/name"}}</span>"

不确定,但请尝试包装文本

测试Magento变量{{config path=“general/store_information/name”}

作为

"Testing Magento variables <span id="name">{{config path="general/store_information/name"}}</span>"

不确定,但请尝试包装文本

测试Magento变量{{config path=“general/store_information/name”}

作为

"Testing Magento variables <span id="name">{{config path="general/store_information/name"}}</span>"

不确定,但请尝试包装文本

测试Magento变量{{config path=“general/store_information/name”}

作为

"Testing Magento variables <span id="name">{{config path="general/store_information/name"}}</span>"

如果您试图将存储名称分配给变量

var greeting = '{{config path="general/store_information/name"}}';
您还可以在admin:system>customvariables(从顶部菜单)中创建自己的自定义变量,并使用调用cms块或页面中的自定义变量

{{customvar code="my_custom_var"}}

顺便说一下,您不应该将html和body标记添加到cms块。

如果您试图将存储名称分配给变量

var greeting = '{{config path="general/store_information/name"}}';
您还可以在admin:system>customvariables(从顶部菜单)中创建自己的自定义变量,并使用调用cms块或页面中的自定义变量

{{customvar code="my_custom_var"}}

顺便说一下,您不应该将html和body标记添加到cms块。

如果您试图将存储名称分配给变量

var greeting = '{{config path="general/store_information/name"}}';
您还可以在admin:system>customvariables(从顶部菜单)中创建自己的自定义变量,并使用调用cms块或页面中的自定义变量

{{customvar code="my_custom_var"}}

顺便说一下,您不应该将html和body标记添加到cms块。

如果您试图将存储名称分配给变量

var greeting = '{{config path="general/store_information/name"}}';
您还可以在admin:system>customvariables(从顶部菜单)中创建自己的自定义变量,并使用调用cms块或页面中的自定义变量

{{customvar code="my_custom_var"}}
顺便说一下,您不应该将html和body标记添加到cms块中