Php Magento-自定义模块添加第2页

Php Magento-自定义模块添加第2页,php,magento,Php,Magento,我已经为此工作了好几天了,我已经为Magento创建了一个自定义模块,以使用此指南添加客户帐户页- 因此,我得到了www.mydomain.com/portfolio,它使用我的布局文件中的以下代码指向自定义模块: <portfolio_index_index> <update handle="customer_account" /> <reference name="root">

我已经为此工作了好几天了,我已经为Magento创建了一个自定义模块,以使用此指南添加客户帐户页-

因此,我得到了www.mydomain.com/portfolio,它使用我的布局文件中的以下代码指向自定义模块:

<portfolio_index_index>
            <update handle="customer_account" />
            <reference name="root">
                    <action method="setTemplate"><template>page/1column.phtml</template></action>
            </reference>
            <reference name="my.account.wrapper">
                <block type="core/template" name="cadaptor_portfolio_content" template="cadaptor_portfolio.phtml"/>           
            </reference>
</portfolio_index_index>
<action method="addLink">
    <name>portfolio_add</name>
    <path>portfolio/add</path>
    <label>Add To Your Portfolio</label>
</action>

第/1页column.phtml
我现在尝试在www.mydomain.com/portfolio/add模块中添加第二个页面,或者类似的内容。实际的URL并不重要

因此,我将其添加到布局文件中:

<portfolio_index_index>
            <update handle="customer_account" />
            <reference name="root">
                    <action method="setTemplate"><template>page/1column.phtml</template></action>
            </reference>
            <reference name="my.account.wrapper">
                <block type="core/template" name="cadaptor_portfolio_content" template="cadaptor_portfolio.phtml"/>           
            </reference>
</portfolio_index_index>
<action method="addLink">
    <name>portfolio_add</name>
    <path>portfolio/add</path>
    <label>Add To Your Portfolio</label>
</action>

投资组合
投资组合/添加
添加到您的投资组合中
这很好用。。。链接出现在菜单中并转到它应该去的地方

还增加了:

<portfolio_add>
            <update handle="customer_account" />
            <reference name="root">
                    <action method="setTemplate"><template>page/1column.phtml</template></action>
            </reference>
            <reference name="my.account.wrapper">
                <block type="core/template" name="cadaptor_portfolio_add" template="cadaptor_portfolio_add.phtml"/>           
            </reference>
</portfolio_add>

第/1页column.phtml

我已经创建并上传了_add模板文件,但除了404错误之外什么都没有,如果有人能帮我一把,我将不胜感激。

首先,添加页面的布局手柄应该是
portfolio\u index\u add
,而不是
portfolio\u add

并在
IndexController.php
中添加以下方法:

public function addAction()
{
    $this->loadLayout();
    $this->renderLayout();
}

你的路径应该是“公文包/索引/添加”

工作得很有魅力!我会尽快接受你的回答,非常感谢。唯一的问题是页面在公文包/索引/添加处工作,这是预期的吗?我可以更改我的链接,这样就不会有问题了,但我不知道索引从何而来。索引是控制器名称,而add是操作,是的,这很正常。如果要保留路径公文包/添加,则必须创建控制器AddControllers.php并在其中使用indexAction()。