3

I created a module for displaying customized form for my website and its works fine.

I want to duplicate the same page with extra one or two fields.

Is it possible to create another page from the same module?

If Yes how can i change the front name and phtml files(Different form with different front name)?

Current link for the page is www.domain.com/subscribe,

I want to create another link like www.domain.com/subscribe_new

My config file

<frontend>
    <routers>
        <htdgetresponse>
            <use>standard</use>
            <args>
                <module>HTD_Getresponse</module>
                <frontName>subscribe</frontName>
            </args>
        </htdgetresponse>
    </routers>
    <layout>
    <updates>
      <htdgetresponse>
        <file>htdgetresponse.xml</file>
      </htdgetresponse>
    </updates>
  </layout>
</frontend>

My Layout.xml File

<?xml version="1.0"?>
<layout version="0.1.0">
<htdgetresponse_index_index>
<reference name="root">   
  <action method="setTemplate"><template>htdgetresponse/getresponse_manage.phtml</template></action>   
</reference>   
<reference name="content">   
  <block type="htdgetresponse/unsubscribe" name="unsubscribe" template="htdgetresponse/index.phtml"/>   
</reference>
</htdgetresponse_index_index>
</layout>

2 Answers 2

1

Yes you can add a second route. As you can see in your config file you already defined one in the tags. Simply add a second one and copy paste your original phtml file, add your modifications and point your new route towards it. Please check out the section "Configuring Routes" in the official Magento documentation here.

1
  • thank you, i did the same yesterday and its success.i too update the answer, with what i did.
    – Mujahidh
    Commented Dec 7, 2015 at 10:05
1

Can Add the second router inside the routers tag. I edit my file like below.

My config file

<frontend>
<routers>
    <htdgetresponse>
        <use>standard</use>
        <args>
            <module>HTD_Getresponse</module>
            <frontName>subscribe</frontName>
        </args>
    </htdgetresponse>

    <!-- newly added code-->
    <htdgetresponse_new>
        <use>standard</use>
        <args>
            <module>HTD_Getresponse</module>
            <frontName>subscribe_new</frontName>
        </args>
    </htdgetresponse_new>
    <!--------------->

</routers>
<layout>
<updates>
  <htdgetresponse>
    <file>htdgetresponse.xml</file>
  </htdgetresponse>

  <!-- newly added code-->
  <htdgetresponse_new>
    <file>htdgetresponse.xml</file>
  </htdgetresponse_new>
  <!--------------->

</updates>

My Layout.xml File

<?xml version="1.0"?>
<layout version="0.1.0">
<htdgetresponse_index_index>
<reference name="root"> 
<action method="setTemplate"><template>htdgetresponse/getresponse_manage.phtml</template></action>
</reference>
<reference name="content">
<block type="htdgetresponse/unsubscribe" name="unsubscribe" template="htdgetresponse/index.phtml"/>
</reference>
</htdgetresponse_index_index>

<!-- newly added code-->
<htdgetresponse_new_index_index>   
<reference name="root">   
  <action method="setTemplate"><template>htdgetresponse/getresponse_manage_new.phtml</template></action>   
</reference>
</htdgetresponse_new_index_index>
<!--------------->

</layout>

And create new file called getresponse_manage_new.phtml in the template folder. That's it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.