Magento标题childhtml下拉列表

时间:2014-01-10 05:32:31

标签: php jquery html css magento

当我点击标题中的链接时,如何将子html块添加为弹出窗口?在这个链接中,我想让“我的帐户”有一个类似于心脏和包图标悬停的下拉列表。

当我尝试创建一个新的.xml文件时,我使用了:

<layout>
    <default>
        <reference name="head">
            <action method="addCss"><stylesheet>css/popup.css</stylesheet></action>
              <action method="addJs"><script>dojo.xd.js</script></action>
        </reference>
                 <reference name="header">
            <block type="myaccountpopup" name="myaccountpopup" template="myaccountpopup.phtml" />
        </reference
    </default>
</layout>

我在链接后添加<?php echo $this->getChildHtml('myaccountpopup') ?>无效。

问题是

  1. 如何确定块类型?
  2. 让这个工作的正确方法是什么?

2 个答案:

答案 0 :(得分:0)

可能是您缺少js的正确标签,包括:

<action method="addJs"><script>dojo.xd.js</script></action> // <--- Here Error

答案 1 :(得分:0)

默认阻止类为Mage_Core_Block_Template。如果任何phtml文件具有块类的渲染。 示例: - <block type="page/html_topmenu" name="catalog.topnav" template="page/html/topmenu.phtml"/> 此处topmenu.phtml有调用类Mage_Page_Block_HTML_Topmen 在您的代码中,您尚未关闭引用标记。

<reference name="header">
    <block type="core/template" name="myaccountpopup" template="myaccountpopup.phtml" />
</reference>
相关问题