简体   繁体   English

阻止代码在magento CMS页面上不起作用

[英]Block Code is not working on magento CMS page

I am showing products from a category on a CMS page by using following code but it not showing anything on front end please have a look and let me know what wrong i am doing 我正在使用以下代码在CMS页面上显示某个类别的产品,但前端未显示任何内容,请看一下,让我知道我在做什么错

I have used this code: 我使用了以下代码:

{{block type="catalog/product_list" category_id="3"template="catalog/product/listhp.phtml"}}

Option #1 选项1

If the below is your code: 如果以下是您的代码:

{{block type="catalog/product_list" category_id="3"template="catalog/product/listhp.phtml"}}

Give a SPACE between category_id="3" and template="..." 在category_id =“ 3”和template =“ ...”之间提供一个空格

Updated code must be: 更新的代码必须是:

{{block type="catalog/product_list" category_id="3" template="catalog/product/listhp.phtml"}}

Let me know if that works. 让我知道是否可行。

[Editing the answer as it can be more than 1 options] [编辑答案,因为可能有多个选项]

Option #2 选项#2

  1. Navigate to System > Permissions > Blocks 导航对系统>权限>块
  2. Add the block - Enter "catalog/product_list" in the field 添加块-在字段中输入“ catalog / product_list”
  3. Set Allowed to Yes 将允许设置为是

Clear cache and check. 清除缓存并检查。

Hope this helps someone. 希望这对某人有帮助。 Happy to Help! 乐意效劳!

Happy Coding... 快乐编码...

I had the same issue Xabby described. 我有Xabby描述的相同问题。

Option #2 by Shivani worked like a charm. Shivani的选项#2就像一个魅力。 Did not know these permissions were necessary. 不知道这些权限是否必要。 In case someone is wondering, these are the steps: 如果有人想知道,请执行以下步骤:

  1. Navigate to System > Permissions > Blocks 导航对系统>权限>块
  2. Add the block - Enter "catalog/product_list" in the field 添加块-在字段中输入“ catalog / product_list”
  3. Set Allowed to Yes 将允许设置为是

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM