Wednesday, January 30, 2013

How to add new link in menu to new CMS page created in magento

Magento 1.5x cheatsheet series
So, you created new link in your fresh magento installation. Maybe you wrote simple FAQ or billing and shipping information for your customers. And now there is no tool to create link to your newly written masterpiece. As far as my research took me, there actually is no such tool built into magento. Little bit of coding on other hand, can solve this problem quickly.
All you have to do is edit file top.phtml.
If you edit built in theme of magento, then location of file is: /app/design/frontend/base/default/template/catalog/navigation
if you work on your own theme, then file should be in folder:
app/design/frontend/your_theme_name/default/template/catalog/navigation

Once you open file for edit, you should locate code
 <div class="nav-container">     
  <ul id="nav">      
  <?php echo $_menu ?>  
   you add code of your new menu object here  
 </ul>  
And code to add is:
 <a href="<?php echo $this->geturl('about-magento-demo-store') ?>">   
 <?php echo $this->__('About Us')?></a>   
Where 'CMS PAGE IDENTIFIER' is to be changed out with your page identifier. Page identifier in CMS is URL Key, for instance About Us is 'about-magento-demo-store'.
So full code of menu with one object which would connect to CMS page "about us" would be:

  <div class="nav-container">     
  <ul id="nav">     
   <?php echo $_menu ?>   
   <a href="<?php echo $this->geturl('about-magento-demo-store') ?>">   
   <?php echo $this->__('About Us')?></a>   
  </ul>   

5 comments:

oakleyses said...

ugg boots, polo outlet, replica watches, tiffany jewelry, louis vuitton outlet, longchamp outlet, louboutin pas cher, tiffany and co, oakley sunglasses, gucci handbags, tory burch outlet, oakley sunglasses, jordan pas cher, ugg boots, kate spade outlet, polo ralph lauren, longchamp pas cher, burberry pas cher, longchamp outlet, prada handbags, christian louboutin, nike outlet, prada outlet, louis vuitton, jordan shoes, nike roshe, louis vuitton, louis vuitton outlet, christian louboutin uk, replica watches, christian louboutin outlet, nike air max, nike free, christian louboutin shoes, ray ban sunglasses, ray ban sunglasses, air max, oakley sunglasses, polo ralph lauren outlet online, nike free run, sac longchamp pas cher, uggs on sale, michael kors pas cher, chanel handbags, longchamp outlet, louis vuitton outlet, cheap oakley sunglasses, ray ban sunglasses, oakley sunglasses wholesale

oakleyses said...

true religion outlet, nike air max uk, timberland pas cher, true religion outlet, michael kors, guess pas cher, michael kors, ray ban uk, michael kors outlet online, hollister uk, nike free uk, burberry outlet, michael kors outlet online, kate spade, mulberry uk, coach outlet store online, uggs outlet, nike air max, north face, sac vanessa bruno, new balance, coach outlet, vans pas cher, replica handbags, michael kors outlet, michael kors outlet online, nike blazer pas cher, lululemon canada, converse pas cher, oakley pas cher, michael kors outlet, ray ban pas cher, true religion outlet, burberry handbags, sac hermes, hogan outlet, nike roshe run uk, nike air force, north face uk, coach purses, michael kors outlet online, abercrombie and fitch uk, polo lacoste, nike air max uk, true religion jeans, michael kors outlet, uggs outlet, hollister pas cher, ralph lauren uk

oakleyses said...

vans outlet, nike roshe run, hollister, iphone cases, north face outlet, insanity workout, beats by dre, nike trainers uk, ralph lauren, soccer jerseys, timberland boots, nike air max, bottega veneta, celine handbags, ferragamo shoes, mac cosmetics, chi flat iron, nike huaraches, lululemon, oakley, hollister, asics running shoes, herve leger, hollister clothing, baseball bats, ghd hair, north face outlet, valentino shoes, lancel, vans, jimmy choo outlet, hermes belt, giuseppe zanotti outlet, abercrombie and fitch, babyliss, mcm handbags, louboutin, ray ban, p90x workout, reebok outlet, nike air max, wedding dresses, mont blanc pens, soccer shoes, converse outlet, nfl jerseys, longchamp uk, gucci, new balance shoes, instyler

oakleyses said...

wedding dresses, thomas sabo, pandora charms, swarovski crystal, ugg,ugg australia,ugg italia, karen millen uk, canada goose outlet, links of london, ugg pas cher, doudoune moncler, ugg uk, supra shoes, canada goose jackets, moncler outlet, coach outlet, swarovski, canada goose outlet, ugg,uggs,uggs canada, louis vuitton, canada goose outlet, pandora jewelry, moncler, louis vuitton, hollister, pandora uk, pandora jewelry, louis vuitton, canada goose, toms shoes, canada goose uk, replica watches, moncler, louis vuitton, moncler uk, louis vuitton, montre pas cher, ugg, moncler outlet, moncler, juicy couture outlet, canada goose, canada goose, moncler, marc jacobs, juicy couture outlet

داليا said...

Lucky me I came across your website
http://www.kuwait.prokr.net/
http://www.emirates.prokr.net/