Magento-确定页面正在使用哪个xml布局文件? [英] Magento - determine which xml layout file a page is using?

查看:82
本文介绍了Magento-确定页面正在使用哪个xml布局文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试阅读文档,但我仍然不太了解magento的xml布局文件如何工作.

I tried reading the documentation but I still don’t really understand how magento's xml layout files work.

在目录app/design/frontend/default/modern/layout中,我看到了很多xml文件.如何确定网站上任何给定页面使用的是哪个xml文件?

In the directory app/design/frontend/default/modern/layout, i see a lot of xml files. How do I determine which xml file any given page on the website is using?

例如,如果我在主页上的http://mysite.com,我正在使用哪个布局xml文件?如果我在http://mysite.com/hello-world上,那应该是哪个xml文件怎么办?

For example, if I were on the home page at http://mysite.com, which layout xml file am I using? What if I’m on http://mysite.com/hello-world, which xml file then?

推荐答案

高级版本:您永远不会只使用一个布局文件.

High level version: You're never using just one layout file.

所有XML文件都合并到一个名为Package Layout的巨型XML文件中.

All the XML files are combined in a giant XML file called the Package Layout.

然后,每个页面请求都会产生许多称为"handles"的特殊字符串符号.

Then, each page request products a number of special string symbols called "handles".

然后,在包布局"中搜索与这些句柄匹配的节点.

Then, the Package Layout is searched for nodes that match these handles.

匹配的节点被组合到一个称为页面布局的XML文件中.

The nodes that match are combined into a single XML files called the Page Layout.

这是任何特定请求使用的布局文件.

That's the layout file any particular request uses.

(无耻但有用的插件随处可见)

(shameless, but useful, plugs follow)

我在此文章中写了更多的深入文章,如果您访问

I wrote a more in depth article on this, and if you go to the Commerce Bug demo page and look at the Layout tab, you can see an example of the handles any page request produces, as well as see output for the Package and Page Layouts.

这篇关于Magento-确定页面正在使用哪个xml布局文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆