如何使用magento在一个页面中添加多个简报?

时间:2014-05-16 12:42:38

标签: magento magento-1.7 magento-1.8

我想在我的网站上添加两个时事通讯。当我将鼠标悬停在topmenu上时,其中一个是在页脚中,另一个是在页脚中。 我试图在我的页面中添加两个时事通讯,它也有效,但问题是如果我在我的网站上添加另一个时事通讯,那么第一个时事通讯不起作用。我不知道问题是什么。 如果有人知道这一点,请帮助我。 谢谢! 我将subscribe_footer.phtml放在\app\design\frontend\default\mytheme\template\newsletter

<div class="row-7-col-1">
                        <h2><?php echo $this->__('newsletter') ?></h2>  
                        <p><?php echo $this->__('Sign up to our newsletter and get exclusive deals you wont find anywhere else straight to your inbox!') ?></p>
                <form action="<?php echo $this->getFormActionUrl() ?>" method="post" id="newsletter-footer-validate-detail-footer">

             <input type="text" name="email" id="newsletter-footer" title="<?php echo $this->__('Sign up for our newsletter') ?>" class="input-text required-entry validate-email" />


          <input type="submit" title="<?php echo $this->__('Submit') ?>" class="newsbtn" value="submit">
          </form></div>
    <script type="text/javascript">
    //<![CDATA[
 var newsletterSubscriberFormDetail = new VarienForm('newsletter-footer-validate-detail-footer');
    //]]>
    </script>
</div>

对于另一份时事通讯,我将subscribe.phtml放在\app\design\frontend\default\mytheme\template\newsletter

<div class="row-7-col-1">
                        <h2><?php echo $this->__('newsletter') ?></h2>  
                        <p><?php echo $this->__('Sign up to our newsletter and get exclusive deals you wont find anywhere else straight to your inbox!') ?></p>
                 <form action="<?php echo $this->getFormActionUrl() ?>" method="post" id="newsletter-validate-detail">

             <input type="text" name="email"  id="newsletter"  class="field required-entry validate-email"/>


          <input type="submit" title="<?php echo $this->__('Submit') ?>" class="newsbtn" value="submit">
          </form></div>
    <script type="text/javascript">
    //<![CDATA[
        var newsletterSubscriberFormDetail = new VarienForm('newsletter-validate-detail');
    //]]>
    </script>
</div>

请检查并告诉我为什么只有一个通讯验证工作

2 个答案:

答案 0 :(得分:0)

<div class="block block-subscribe">
<form action="<?php echo $this->getFormActionUrl() ?>" method="post" id="newsletter-validate-detail_footer">
        <input type="text" name="email" placeholder="Enter email" id="email_footer" class="input-text required-entry validate-email mytxt2" />
    <button type="submit" title="<?php echo $this->__('Subscribe') ?>" class="button"><span><span><?php echo $this->__('Subscribe') ?></span></span></button>
</form>
<script type="text/javascript">
    //<![CDATA[
    var newsletterSubscriberFormDetail_footer = new VarienForm('newsletter-validate-detail_footer');
    //]]>
</script>

答案 1 :(得分:-1)

两个简报正在运行,验证也为我工作。 复制newsletter/subscribe文件并重命名为newsletter/subscribe2。 然后只需在简报上重命名验证名称。