Pages

Sunday, April 25, 2010

URLs in Magento

2 simple rules to keep in mind when insert a link or an image in a Magento:
- getBaseUrl()
-getSkinUrl()



Next, when you create a link it's easy just to say:
.... href="http://www.blogger.com/customer/account"
instead you should use: ... href="<?php $this->getBaseUrl(); ?>customer/account" ...

For images:
img src="/skin/frontend/default/SKIN_NAME/images/rss.png"
instead you should use: img src="<?php $this->getSkinUrl('images/rss.png');?>" ...

No comments: