Are Magento core questions related to core issues?

Here is what I think about Magento (plz fix me if I am wrong)

1) Each module has its own layout.xml stored in / interface / theme / layouts / folder. 2) Magento downloads all of these layouts for the current theme and creates a large XML file.

Now I'm confused.

a) If magento loads / default / default / (interface and theme), then why are all the templates and layouts inside base / default / ??

b) that if I create the name of my module β€œpage” inside my namespace β€œJason”, that is, Jason_Page, now what happens to the blocks in the layout files called

c) Since all layouts are loaded and combined into one large XML file, what happens with all of these reference blocks that have the same name attribute and are in the "Default" descriptor tag? eg

d) what is the Local.xml layout and its use? e) wats the ship relationship between the module name foo and its layout name foo.xml? What happens to layout.xml if there are two modules with the same name in the diff namespace?

Thanks in advance.

+3
source share
3 answers

1) Each module can choose the definition of layout files that are in the / interface / theme / layouts / folder. You can accomplish this by specifying layouts in the module's config.xml file as follows:

<frontend>
    <layout>
        <updates>
            <jason_page>
                <file>jasonpage.xml</file>
            </jason_page>
        </updates>
    </layout>
</frontend>

2) Yes.

a) Magento descendency. , , . , .

b) , config.xml:

<global>
    <blocks>
        <jason_page>
            <class>Jason_Page_Block</class>
        </jason_page>
    </blocks>
</global>

jason_page, . , , :

<block type='jason_page/blockname' as='blockname' name='blockname' />

: Jason_Page_Block_Blockname /app/code/local/Jason/Page/Block/Blockname.php

c) , <reference> , , . name/as , . , , , .

d) local.xml( /etc ) , . .

d 2). , , . , , , . , (, ), config.xml.

, !

,

+3

, interface/theme/layout/local.xml, XML .

.

0

, . :

: Magento Admin

Magento- > - >

1) ,

2) ( , ), ,

3) ,

4)

2) ! . , .

:

FTP- Magento footer.phtml app- > design- > frontend β†’ default β†’ ( ) β†’ template- > page- > footer.phtml

, , :

getLayout() β†’ createBlock ( "/) β†’ setBlockId (" --) β†’ toHtml();? >

Static- , .

1) , :

getLayout() β†’ createBlock ( "/) β†’ setBlockId (" --) β†’ toHtml();? >

:

-

2) .xml app- > - > frontend- > default- > f002- > layout- > catalog.xml

-

0

Source: https://habr.com/ru/post/1746652/


All Articles