【发布时间】:2014-07-28 14:33:21
【问题描述】:
我对 Magento 很陌生,我正在尝试在自定义 Magento 主题的页脚中呼应内置的联系表单。 它无法正常工作,这是我的代码:
form.phtml 的路径:(app/design/frontend/default/mytheme/template/contacts/form.phtml)
XML (app/design/frontend/default/mytheme/layout/page.xml:
<block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml">
<block type="page/html_wrapper" name="bottom.container" as="bottomContainer" translate="label">
<label>Page Footer</label>
<action method="setElementClass">
<value>bottom-container</value>
</action>
</block>
<block type="page/template_links" name="footer_links" as="footer_links" template="page/template/links.phtml"/>
<block type="page/template_links" name="top.links" as="topLinks"/>
<block type="contacts/form" name="form" as="form" template="contacts/form.phtml"/>
//the contact form
<block type="newsletter/subscribe" name="newsletter" template="newsletter/subscribe.phtml"/>
<block type="cms/block" name="cms_footer_contact">
<action method="setBlockId">
<block_id>contact_info</block_id>
</action>
</block>
</block>
php (app/design/frontend/default/mytheme/template/page/html/footer.phtml):
<div class="footer">
<div class="col3-set">
<div class="col-1">
<div class="footer-links">
<?php echo $this->getChildHtml('cms_footer_links') ?>
<?php echo $this->getChildHtml('footer_links') ?>
</div>
</div>
<div class="col-2">
<h2 class="<footer-title"><?php echo $this->__('Ask us') ?></h2>
<?php echo $this->getChildHtml('contact-form') ?>
<?php echo $this->getChildHtml('form') ?> //echoing the form
</div>
<div class="col-3">
<h2 class="footer-title"><?php echo $this->__('Contact Details') ?></h2>
<div class="footer-contacts">
<?php
if(Mage::getStoreConfig("trego_settings/footer/newsletter", $code)){
echo $this->getChildHtml('newsletter');
}
?>
<div class="contact-info">
<?php echo $this->getChildHtml('cms_footer_contact') ?>
</div>
</div>
</div>
</div>
<div class="footer-menu">
<?php echo $this->getChildHtml('topLinks') ?>
<?php echo $this->getChildHtml('footer_socialIcons'); ?>
<?php echo $this->getChildHtml('footer_copyrights'); ?>
</div>
</div>
【问题讨论】:
-
我对 Magento 也很陌生。但是,当我有一个与 Magento 相关的问题时,我会将其发布在:magento.stackexchange.com - 可能需要更长的时间才能得到答案,但答案通常要好得多。
标签: php xml forms magento footer