1

I have been searching and experimenting for days now on a solution for getting custom product attribute data into a static block. I decided to go ahead and use a call to a template file that defines the call to the products attribute.

The problem however, is that my Magento Community 1.7 installation doesnt render any variables, either within CMS pages, product attributes, or static blocks. I have seen everwhere that this is the way to do it. I put in something such as the following:

{{block type="core/template" template="/catalog/product/compatibility.phtml"}}

After saving, and making sure that HTML on the frontend is set to yes, I check to see if it worked. What I see is the exact code of the variable and not that it even tried to access the template file. I have even tried inserting stock variables (such as a widget or even just the store name) into a page/static block to see if they render but they dont NONE do.

Am I missing something? Is there something that needs to be enabled for variables to work at all on my site? Spent 4 solid days ripping my hair out already

4

1 回答 1

1

如果这太简单了,请原谅我,但是您是否确保在将代码粘贴到块中之前单击以隐藏/禁用 WYSIWYG 编辑器?

如果您将代码直接粘贴到 WYSIWYG editpr 中,它将对标签进行编码并停止对其进行正确解析。

此外,您不需要在模板路径中使用斜杠:

{{block type="core/template" template="catalog/product/compatibility.phtml"}}
于 2012-09-27T13:17:33.113 回答