Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/226.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在Magento中查找正确的模板和块_Php_Magento - Fatal编程技术网

Php 在Magento中查找正确的模板和块

Php 在Magento中查找正确的模板和块,php,magento,Php,Magento,我正在尝试更改Magento onepage签出页面。我查过了 $find . -iname *onepage* 我在Magento/目录中得到了onepage.phtml的5-6个结果。这些页面中有两个具有完全相同的来源,或者几乎完全相同的来源。有没有更好的方法让我知道哪个文件是加载到站点上的文件,而不是使用“试用”方法并编辑它们,直到找到我需要的文件?您可以选择使用模板提示。对于Magento开发人员来说,这是一个非常漂亮的工具。模板提示将显示在Magento站点的每个页面上查找每个可见文

我正在尝试更改Magento onepage签出页面。我查过了

$find . -iname *onepage*

我在Magento/目录中得到了onepage.phtml的5-6个结果。这些页面中有两个具有完全相同的来源,或者几乎完全相同的来源。有没有更好的方法让我知道哪个文件是加载到站点上的文件,而不是使用“试用”方法并编辑它们,直到找到我需要的文件?

您可以选择使用模板提示。对于Magento开发人员来说,这是一个非常漂亮的工具。模板提示将显示在Magento站点的每个页面上查找每个可见文件的位置。登录后端并按照图片查看如何为前端打开它们。 将两个模板路径提示都设置为“是”,并将块名称添加到提示。瞧,您的站点应该是这样的:(另外,默认情况下,模板路径提示不会显示在默认站点范围中,您可能需要选择一个特定站点来启用它们):

现在,如果您需要更改后端(管理面板),该怎么办?这一部分同样简单,不过您必须对某些代码进行一些更改。在你的

app/code/local/Mage/Core/etc/system.xml
目录中有一段代码,如下所示:

                        <template_hints translate="label">
                        <frontend_type>select</frontend_type>
                        <source_model>adminhtml/system_config_source_yesno</source_model>
                        <sort_order>20</sort_order>
                        <show_in_default>0</show_in_default>
                        <show_in_website>1</show_in_website>
                        <show_in_store>1</show_in_store>
                    </template_hints>
                    <template_hints_blocks translate="label">
                        <label>Add Block Names to Hints</label>
                        <frontend_type>select</frontend_type>
                        <source_model>adminhtml/system_config_source_yesno</source_model>
                        <sort_order>21</sort_order>
                        <show_in_default>0</show_in_default>
                        <show_in_website>1</show_in_website>
                        <show_in_store>1</show_in_store>
                    </template_hints_blocks>

选择
adminhtml/system\u config\u source\u yesno
20
0
1.
1.
向提示中添加块名
选择
adminhtml/system\u config\u source\u yesno
21
0
1.
1.

现在,将两个show_in_默认设置从0更改为1。返回默认站点范围下的管理面板>系统>配置>开发人员,您将拥有启用模板路径提示和块名称的选项。如果现在将这两个选项都设置为“是”,它将为“管理”面板启用模板路径提示。

您可以选择使用模板提示。对于Magento开发人员来说,这是一个非常漂亮的工具。模板提示将显示在Magento站点的每个页面上查找每个可见文件的位置。登录后端并按照图片查看如何为前端打开它们。 将两个模板路径提示都设置为“是”,并将块名称添加到提示。瞧,您的站点应该是这样的:(另外,默认情况下,模板路径提示不会显示在默认站点范围中,您可能需要选择一个特定站点来启用它们):

现在,如果您需要更改后端(管理面板),该怎么办?这一部分同样简单,不过您必须对某些代码进行一些更改。在你的

app/code/local/Mage/Core/etc/system.xml
目录中有一段代码,如下所示:

                        <template_hints translate="label">
                        <frontend_type>select</frontend_type>
                        <source_model>adminhtml/system_config_source_yesno</source_model>
                        <sort_order>20</sort_order>
                        <show_in_default>0</show_in_default>
                        <show_in_website>1</show_in_website>
                        <show_in_store>1</show_in_store>
                    </template_hints>
                    <template_hints_blocks translate="label">
                        <label>Add Block Names to Hints</label>
                        <frontend_type>select</frontend_type>
                        <source_model>adminhtml/system_config_source_yesno</source_model>
                        <sort_order>21</sort_order>
                        <show_in_default>0</show_in_default>
                        <show_in_website>1</show_in_website>
                        <show_in_store>1</show_in_store>
                    </template_hints_blocks>

选择
adminhtml/system\u config\u source\u yesno
20
0
1.
1.
向提示中添加块名
选择
adminhtml/system\u config\u source\u yesno
21
0
1.
1.

现在,将两个show_in_默认设置从0更改为1。返回默认站点范围下的管理面板>系统>配置>开发人员,您将拥有启用模板路径提示和块名称的选项。如果现在将这两个选项都设置为“是”,它将为“管理”面板启用模板路径提示。

将Magento视为乐高积木。你可以从一个页面开始,页面上有一些洞,用来填充内容。这些漏洞有块来填充它们,可能还有更多的漏洞用于插入内容块,一直到非常基本和特定的内容,比如价格。根据您在网站上所处的区域,提供宏内容将涉及不同的模块树。代码为MVC(模型视图控制器),显示为布局和模板。观察下面的模板提示,思考它们与上述描述的关系,你很快就会发现没有它们的模板。自我推广链接,所以我不会在下面重复fish,但正是你所问的情况导致我构建Commerce Bug(),Magento调试扩展。如果公司有钱,参加当地的培训是很有用的。他们还提供同一培训的点播视频,但缺少一些可以帮助你学习的实际互动。本次培训针对的是基础知识,可以很好地介绍其工作原理。将Magento视为乐高积木。你可以从一个页面开始,页面上有一些洞,用来填充内容。这些漏洞有块来填充它们,可能还有更多的漏洞用于插入内容块,一直到非常基本和特定的内容,比如价格。根据您在网站上所处的区域,提供宏内容将涉及不同的模块树。代码为MVC(模型视图控制器),显示为布局和模板。观察下面的模板提示,思考它们与上述描述的关系,你很快就会发现没有它们的模板。自我推广链接,所以我不会在下面重复fish,但正是你所问的情况导致我构建Commerce Bug(),Magento调试扩展。如果公司有钱,参加当地的培训是很有用的。他们还提供同一培训的点播视频,但缺少一些可以帮助你学习的实际互动。本次培训针对的是基础知识,可以很好地介绍所有的工作原理