Question

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!

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top