1

I have a few links in the home page. for e.g. link1 , link2, link3 When I click link1 want to load the page link1.phtml , link2 to load link2.phtml and link3 to load link3.phtml

Know it is possible to create a page in admin cms and then loading the page. But is it possible to do it in the local.xml file without touching the admin . The reason is I have about 15 links on the home page that needs to be showing some information.

Please can anyone help with the codes

New Link

How to map this to a link or please correct me if my approach is wrong

  • you need separate page for each .phtml file – MeenakshiSundaram R Jun 23 '15 at 9:32
  • yes, I do have seperate page for each .phtml page, but please how to map them to <ahref='whattogivehere'>link 1</a> – user27321 Jun 23 '15 at 9:36
  • you have to create custom module for this – MeenakshiSundaram R Jun 23 '15 at 9:40
  • is it going to be very tough or easy, please can you send any links or a short example to start with – user27321 Jun 23 '15 at 9:44
1

Follow this Link to create custom module with controller

Then create new actions for each links in your controller file

app/code/local/Baobaz/Arithmetic/controllers/IntegerController.php

public function link1Action()
{
    $this->loadLayout();
    $this->renderLayout();
}

Now you have change the content of each page, So you need to change in layout file

app/design/frontend/default/default/layout/arithmetic.xml

<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
     ...
    <arithmetic_integer_link1>
        <reference name="root">
            <action method="setTemplate">
                <template>page/1column.phtml</template>
            </action>
        </reference>
        <reference name="content">
            <block type="core/template" name="arithmetic_integer_multiply" template="yourfolder/link1.phtml"></block>
        </reference>
    </arithmetic_integer_link1>
    ...
</layout>

Like this you can add more action for each links.

To link for these pages

$this->getUrl('arithmetic/integer/link1');

Here arithmetic ->your module name integer -> your controller link1 -> your action.

  • <routers> <Bibliografi> <use>standard</use> <args> <module>Bibliografi_Homecatg</module> <frontName>homecatg</frontName> </args> </Bibliografi> </routers> <layout> <updates> <Bibliografi> <file>homecatg.xml</file> </Bibliografi> </updates> </layout> but the homecatg.xml is nto called at all, any help please, – user27321 Jun 23 '15 at 13:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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