Here is another way to put static links in the Magento directory menu.
First create a static page, assign it the url key, for example, "my-test-page".
Go to / app / code / core / Mage / Catalog / Block, copy the Navigation.php file to / app / code / local / Mage / Catalog / Block, now you can edit it without fear of the possibility of losing your changes with the Magento update.
Open the Navigation.php file on line 265 (magento 1.4) function _renderCategoryMenuItemHtml(...) , change the code:
$htmlLi .= '>'; $html[] = $htmlLi; $html[] = '<a href="'.$this->getCategoryUrl($category).'"'.$linkClass.'>'; $html[] = '<span>' . $this->escapeHtml($category->getName()) . '</span>'; $html[] = '</a>';
:
$htmlLi .= '>'; $html[] = $htmlLi; if(preg_match('/\/static-/', $this->getCategoryUrl($category))) { $link_url = str_replace("static-", "", $this->getCategoryUrl($category)); } else { $link_url = $this->getCategoryUrl($category); } $html[] = '<a href="'.$link_url.'"'.$linkClass.'>'; $html[] = '<span>' . $this->escapeHtml($category->getName()) . '</span>'; $html[] = '</a>';
Now go to Category Management, change the category, change the URL to this: "static-my-test-page" and uncheck "Create a permanent redirect for the old URL". After saving the category, you will have a link to my test page in the main categories menu in Magento.
So, after all the changes, you can convert the category link into a static link to the page by adding the prefix βstatic-β to the category URL.
source share