How to create a custom page in magento and link it to a new menu

STEPS FOR CREATING A CUSTOM PAGE IN MAGENTO AND LINK IT TO A NEW MENU

1. Login as admin, Then select ‘Manage Pages’ from CMS menu.
2. Click ‘Add New Page’ Button to create a page.
3. In the New Page:

a) In General Information tab enter following details:
Page Title: Test Page
SEF URL Indentifier: test1
Store View: All Store Views
Status: Enabled
Content: Enter some text here..

b) Custome Design: Select your own layout from this tab
Select Layout: Three Column (you can select any layout)

c) Meta Data: If you want to add Keywords and Descriptions

Then click on ‘Save Page’ button. Now your test page is ready.

4. Now we have to create a new menu to link this page. Open app/design/frontend/default/default/template/catalog/navigation/top.phtml

Enter following line just above the foreach statement.

[sourcecode language=”php”]
<li><a href="<?php echo $this->getUrl(‘test1′)?>"><?php echo $this->__(‘Staff’) ?></a></li>

[/sourcecode]

Here test1 is the SEF URL Identifier and Staff is the new menu name.

Now your menu is ready.  Go to magento frontend and click on ‘Staff’ menu to see your new page.

22 comments on “How to create a custom page in magento and link it to a new menu

  • HI,

    I am new for magento how can i add link category menu to a cms page? my category link is like this

    * Home
    * Empresa
    o História
    * Serviços
    * Equipamentos Médico- Hospitalares
    o Fabricados pela AJC
    + Esterilizadores Horizontais
    + Esterilizadores Verticais
    o Comercializados pela AJC
    * Acessórios
    * Noticias
    * Contactos
    1. Serviços, Acessórios, Noticias, Contactos, should be linked to a CMS page

    your help will be appreciated. Thank in advance.

  • Rajeev Pillai
    Rajeev Pillai says:

    Hi
    Open app/design/frontend/default/default/template/catalog/navigation/top.phtml file and paste the following code in between <ul id="nav"> and foreach:

    <li class="level0 nav- parent" onmouseout="toggleMenu(this,0)" onmouseover="toggleMenu(this,1)"> href="http://localhost/mg/index.php/catalog/category/view/s/historia/id/10/" rel="nofollow"><span>Historia</span></a> <ul class="level0"> <li class="level1 nav-"> <a href="http://localhost/mg/index.php/catalog/category/view/s/servicos/id/22/"><span>Servicos</span></a> </li> <li class="level1 nav- last"> <a href="http://localhost/mg/index.php/catalog/category/view/s/equipamentos-medico-hospitalares/id/23/"><span>Equipamentos Medico- Hospitalares</span></a> </li> </ul> </li>

    Try this!

  • I cant able to find those path “app/design/frontend/default/default/template/catalog/navigation/top.phtml”, i can navigate upto this path “app/design/frontend/default/default” but under the last default folder there are two folders “etc” and “locale”, can you please guide from where i have to create menu for newly created module.

  • Sree

    etc and locale come inside the code folder! Normal/default Magento installation has app/design/frontend/default/default/template/catalog/navigation/top.phtml may be you can search for top.phtml file to see which folder it is in.

    Regards Sree

  • tanveerabbas says:

    Hi
    I m tanveer Abbas. i m new new user in magneto. i want to facing some problems

    1- plz help me how i can create new menu and any place of page
    2- plz help me how i create catalog and show products in front page.
    3- plz help me how i can manage front hand in breadcrum and products

    i m sure and confident that u will help me in solving this problems and u will teach me and tell me step by step. i shall be thankful

    your faithful Tanver Abbas
    my email address is that tanveerabbas123@yahoo.com

    PLZ REPLY ME AS SOON AS POSSIBLE

  • Rajeev Pillai
    Rajeev Pillai says:

    1. login as admin, then select Manage Categories from Catelog menu.
    2. Fill Following:
    Name: your_menu_name
    Is Active: Yes
    Is Anchor: Yes

    Then click on Save Category button.

    Please make sure that your new menu is under . If not drag it to root category.

  • i am new to magento. i have one menu in my header named as”new”. when i click “new” link, it will display latest products in a new page.

    and also i need to display 2 products per page

    pls help me how can i do this .(it is urgent)

  • gurukumar says:

    Reply for “How to create a custom page in magento and link it to a new menu”.

    i have modified code in top.phtml.every thing is ok but if newly added menu is selected css is not changing for it like other menus

  • gurukumar, u should put the line within div class, under tag;

    —put the lin here—

  • Hello Rajeev,
    I followed your indications step by step, where I have the universalshop them installed, and was working within my new magento installation.

    Sorry for what I’m going to say, i’m so new on magento board (since a couple of days only).

    After installing the universal them, I wanted to create a new page named as “legal aspects”.
    So I create it in the CSS, I liked it to legal-aspects, and then I went to ./app/design/frontend/default/universalshop/template/catalog/navigation/top.phtml…
    Then I add after line 38, where “shoplink” href=””>Shop, the following:
    <a href="getUrl(‘legal-aspects’)?>”>__(‘Legal Aspects’) ?>

    Also, i asked to change the Shop label name to be “Store”

    I saved, then i come back to refresh my web…

    BUT,
    I couldn’t find the new paged add as I wanted, neither the shop name changed, and more over, I got activated the Path Hints on above the home menu, showing in red “frontend/default/universalshop/template/catalog/navigation/top.phtml” And the same in the footer “frontend/default/universalshop/template/page/html/footer.phtml”..

    The question that i didn’t touch even the footer file, neither i see the Path Hints ON in my config menu…
    But when I turn the language from english to french, or german, the Path Hints desired, but i don’t see any change which i applied for…You can see the chaus which I did in the site, where i install it in live right now…

    What wrong I did??

    Helpppppp

    Sam

  • Refresh your cache. When you change a template file to add a menu item, you will not see it unless you delete the cache files under var/cache folder.

    You can also disable Cache under the admin panel conguration ->manage cache menu

  • HI all

    I am new to magento.I need to create an extra form in my frontend using magento.It has around 10 html fields.How can I crerate this form and add the details to database

    Thanks

    please help me

  • Rutul Suthar says:

    Hi,

    I m newbie in Magento.
    I want to show my cms pages’ links in top menu without adding static links of them in top.phtml.
    When admin adds new cms page, it should come with link in top navigation menu at front side.

    Is if possible, if yes how can i do it?

    Thanks,
    Rutul

  • Hi,
    Thank you so much for your above tutorial. However I have a few questions as it hasn’t worked for me. The new menu name ‘Staff’, was it declared anywhere in magento before being incorporated in the code?
    On my website I need a new custom horizontal menu just under the logo with Home, New Arrivals, Best Sellers and Sale. Can you please advise me how to achieve that? If you look at jilbabsrus.co.uk, you will understand what I am trying to achieve. Please any help would be greatly appreciated. Thank you

  • I do agree with all of the ideas you’ve introduced to your post. They’re
    very convincing and will certainly work.
    Still, the posts are very short for beginners. May you please
    extend them a little from next time? Thank you
    for the post.

Comments are closed.