0

I've searched hi and low for an answer to this seemingly simple question, however I have not found a working solution.

My top nav menu in Magento is hard-coded to include CMS pages (no problems there as the CMS pages are built off of the BaseURL) However one of my links needs to go to an external site but everything I've coded so far is adding the baseURL and therefore is going to 404 Page.

Here is an example of the most recent code I've used - I removed the Mage::BaseURL from the code. Still no luck. I did see a crazy work-around through categories but would prefer to not go that route as I have less control of where link will be located in the top nav menu (my categories load first, but this link needs to be the last in nav)

class="level0 level-top first"><a class="level-top" href="<?php echo $this->getUrl('http://www.externallink.com/')?>"><span><?php echo $this->__("Restaurant") ?></span></a>

Anyone have a suggestion? I'm stuck. Thanks!

Tara M.
  • 15
  • 4

1 Answers1

0

You don't need to use PHP code to echo out the link. Just put it in the HTML. When you call 'getUrl()' it will prepend the base_url

Joe Constant
  • 812
  • 2
  • 13
  • 29
  • Thanks Joe! I just saw this answer and I realize I made this way too complicated. I actually came to post that I had solved my own problem: "; ?>">__("Restaurant") ?> – Tara M. May 18 '12 at 18:07
  • @Tara M. Hi Tara, could you please tell me in which file you put this link? It seems that as of Magento 1.7, the structure of the files has drastically changed, and all I can manage to find is articles and tuts about how to do this in 1.6 or earlier versions... – paddotk Nov 14 '12 at 14:18