I create a phtml file which clone the original contact form. And i would insert this file to contact page.
My contact form urlkey is 'contacts'. In the result, we can see the contact form at mysite/contacts
btw how can i add the new phtml file in contact.xml file? i added like this,
/app/design/frontend/rwd/default/layout/contact.xml
<layout version="0.1.0"> <contacts_index_index translate="label"> <label>Contact Us Form</label> <reference name="head"> <action method="setTitle" translate="title" module="contacts"><title>Contact Us</title></action> </reference> <reference name="root"> <action method="setTemplate"><template>page/1column.phtml</template></action> <action method="setHeaderTitle" translate="title" module="contacts"><title>Contact Us</title></action> </reference> <update handle="cms_menu"/> <reference name="content"> <block type="core/template" name="contactForm" template="contacts/form.phtml"/> <block type="core/template" name="contactForm" template="contacts/clone-form.phtml"/> //this one is what i insert in </reference> </contacts_index_index>
Solved! Go to Solution.
Hi guy,
We are have two way to do it.
1. pleae change name of the new form that you added, example: name = "contactFormAdd"
so your code will be:
<block type="core/template" name="contactFormAdd" template="contacts/clone-form.phtml"/>
2. in the contacts/form.phtml file, please add this code at footer:
<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('contacts/clone-form.phtm') ->toHtml().
Hope that will help you.
You replace from.phtml with your file abc.phtml just
change
<reference name="content"> <block type="core/template" name="contactForm" template="contacts/form.phtml"/> </reference>
To
<reference name="content"> <block type="core/template" name="contactForm" template="foldername/abc.phtml"/> </reference>
I wanna put two phtml files at this code!
Hi guy,
We are have two way to do it.
1. pleae change name of the new form that you added, example: name = "contactFormAdd"
so your code will be:
<block type="core/template" name="contactFormAdd" template="contacts/clone-form.phtml"/>
2. in the contacts/form.phtml file, please add this code at footer:
<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('contacts/clone-form.phtm') ->toHtml().
Hope that will help you.
Hi guy,
We are have two ways to do it.
1. pleae change name of the new form that you added, example: name = "contactFormAdd"
so your code will be:
<block type="core/template" name="contactFormAdd" template="contacts/clone-form.phtml"/>
2. in the contacts/form.phtml file, please add this code at footer:
<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('contacts/clone-form.phtm') ->toHtml().
Hope that will help you.