将TopLink移动到Magento中的另一个块

将TopLink移动到Magento中的另一个块,magento,Magento,我试图将顶部链接移动到我在标题上方创建的静态块。目前,我只获得“注销”链接,而不是所有顶级链接(我的帐户、我的愿望列表、我的购物车和结帐)。如何将所有这些链接都放入静态块中 2列右侧。phtml <head> <?php echo $this->getChildHtml('head') ?> </head> <body<?php echo $this->getBodyClass()?' class="'.$thi

我试图将顶部链接移动到我在标题上方创建的静态块。目前,我只获得“注销”链接,而不是所有顶级链接(我的帐户、我的愿望列表、我的购物车和结帐)。如何将所有这些链接都放入静态块中

2列右侧。phtml

<head>
    <?php echo $this->getChildHtml('head') ?>
    </head>
    <body<?php echo $this->getBodyClass()?' class="'.$this->getBodyClass().'"':'' ?>>
    <?php echo $this->getChildHtml('after_body_start') ?>
    <div class="wrapper">
        <?php echo $this->getChildHtml('global_notices') ?>
        <div class="page">
            <div><?php echo $this->getChildHtml('newreference') ?></div>
            <?php echo $this->getChildHtml('header') ?>
            <div class="main-container col2-right-layout">
                <div class="main">
                    <?php echo $this->getChildHtml('breadcrumbs') ?>
                    <div class="col-main">
                        <?php echo $this->getChildHtml('global_messages') ?>
                        <?php echo $this->getChildHtml('content') ?>
                    </div>
                    <div class="col-right sidebar"><?php echo $this->getChildHtml('right') ?></div>
                </div>
            </div>
            <?php echo $this->getChildHtml('footer') ?>
            <?php echo $this->getChildHtml('global_cookie_notice') ?>
            <?php echo $this->getChildHtml('before_body_end') ?>
        </div>
    </div>
    <?php echo $this->getAbsoluteFooter() ?>
    </body>
    </html>
<p class="welcome-msg"><?php echo $this->getChildHtml('welcome') ?> <?php echo $this->getAdditionalHtml() ?></p>
        <div class="quick-access">
            <?php echo $this->getChildHtml('topLinks') ?>
        </div>
<?xml version="1.0" encoding="UTF-8"?>
    <layout>
        <default>
            <reference name="root">
                <block type="core/text_list" name="newreference" as="newreference" translate="label">
                    <label>New Reference</label>
                </block>
            </reference>
            <reference name="newreference">
                <block type="core/template" name="newreferenceblock" template="newreference.phtml">
                    <block type="page/template_links" name="top.links" as="topLinks"/>
                </block>
            </reference>
        </default>
    </layout>

>
newReference.phtml

<head>
    <?php echo $this->getChildHtml('head') ?>
    </head>
    <body<?php echo $this->getBodyClass()?' class="'.$this->getBodyClass().'"':'' ?>>
    <?php echo $this->getChildHtml('after_body_start') ?>
    <div class="wrapper">
        <?php echo $this->getChildHtml('global_notices') ?>
        <div class="page">
            <div><?php echo $this->getChildHtml('newreference') ?></div>
            <?php echo $this->getChildHtml('header') ?>
            <div class="main-container col2-right-layout">
                <div class="main">
                    <?php echo $this->getChildHtml('breadcrumbs') ?>
                    <div class="col-main">
                        <?php echo $this->getChildHtml('global_messages') ?>
                        <?php echo $this->getChildHtml('content') ?>
                    </div>
                    <div class="col-right sidebar"><?php echo $this->getChildHtml('right') ?></div>
                </div>
            </div>
            <?php echo $this->getChildHtml('footer') ?>
            <?php echo $this->getChildHtml('global_cookie_notice') ?>
            <?php echo $this->getChildHtml('before_body_end') ?>
        </div>
    </div>
    <?php echo $this->getAbsoluteFooter() ?>
    </body>
    </html>
<p class="welcome-msg"><?php echo $this->getChildHtml('welcome') ?> <?php echo $this->getAdditionalHtml() ?></p>
        <div class="quick-access">
            <?php echo $this->getChildHtml('topLinks') ?>
        </div>
<?xml version="1.0" encoding="UTF-8"?>
    <layout>
        <default>
            <reference name="root">
                <block type="core/text_list" name="newreference" as="newreference" translate="label">
                    <label>New Reference</label>
                </block>
            </reference>
            <reference name="newreference">
                <block type="core/template" name="newreferenceblock" template="newreference.phtml">
                    <block type="page/template_links" name="top.links" as="topLinks"/>
                </block>
            </reference>
        </default>
    </layout>

local.xml

<head>
    <?php echo $this->getChildHtml('head') ?>
    </head>
    <body<?php echo $this->getBodyClass()?' class="'.$this->getBodyClass().'"':'' ?>>
    <?php echo $this->getChildHtml('after_body_start') ?>
    <div class="wrapper">
        <?php echo $this->getChildHtml('global_notices') ?>
        <div class="page">
            <div><?php echo $this->getChildHtml('newreference') ?></div>
            <?php echo $this->getChildHtml('header') ?>
            <div class="main-container col2-right-layout">
                <div class="main">
                    <?php echo $this->getChildHtml('breadcrumbs') ?>
                    <div class="col-main">
                        <?php echo $this->getChildHtml('global_messages') ?>
                        <?php echo $this->getChildHtml('content') ?>
                    </div>
                    <div class="col-right sidebar"><?php echo $this->getChildHtml('right') ?></div>
                </div>
            </div>
            <?php echo $this->getChildHtml('footer') ?>
            <?php echo $this->getChildHtml('global_cookie_notice') ?>
            <?php echo $this->getChildHtml('before_body_end') ?>
        </div>
    </div>
    <?php echo $this->getAbsoluteFooter() ?>
    </body>
    </html>
<p class="welcome-msg"><?php echo $this->getChildHtml('welcome') ?> <?php echo $this->getAdditionalHtml() ?></p>
        <div class="quick-access">
            <?php echo $this->getChildHtml('topLinks') ?>
        </div>
<?xml version="1.0" encoding="UTF-8"?>
    <layout>
        <default>
            <reference name="root">
                <block type="core/text_list" name="newreference" as="newreference" translate="label">
                    <label>New Reference</label>
                </block>
            </reference>
            <reference name="newreference">
                <block type="core/template" name="newreferenceblock" template="newreference.phtml">
                    <block type="page/template_links" name="top.links" as="topLinks"/>
                </block>
            </reference>
        </default>
    </layout>

新参考
试试这个

    <reference name="newreference">
        <block type="core/template" name="newreferenceblock" template="newreference.phtml">
            <block type="page/template_links" name="top.links" as="topLinks"/>
        </block>
   </reference>

将此更改为

<reference name="newreference">
    <block type="core/template" name="newreference" template="newReference.phtml">
        <block type="page/template_links" name="top.links" as="topLinks"/>
    </block>
</reference>


当我这样做时,该块将完全消失。当它消失时,请尝试退出;在newReference.phtml和links.phtml中?它正在退出吗?与newReference.phtml和links.phtml中的“exit;”结果相同。当我这样做时,该块将完全消失。这意味着不会调用newReference.php。因为customer.xml中定义了一个块,所以它只显示登录或注销按钮。尝试在page.xml.a中添加引用块代码。之所以调用newReference.phtml,是因为我已将代码添加到页面中,该页面在功能上显示在网站上。B我已经将引用代码块添加到page.xml中,但它仍然不起作用。还有什么想法吗?