jcadima
5/9/2017 - 7:39 PM

Magento URLs for CMS pages and Templates

Magento URLs for CMS pages and Templates


https://php.quicoto.com/getbaseurl-magento-url-path/
https://stackoverflow.com/questions/11723959/magento-getproducturl-is-not-returning-the-right-url-random

======== IMAGES IN CMS PAGES ===========
to get <img src="http://popbetaserver.com/projects/mercoframes/media/wysiwyg/spinner.gif">

<img src="{{media url="wysiwyg/spinner.gif"}}">

To just get the image url:
{{media url="wysiwyg/spinner.jpg"}}


To get SKIN URL -> {{skin url='images/image.jpg'}}
To get Media URL -> {{media url='/image.jpg'}}
To get Base URL -> {{base url='store/page.html'}}
To get Store URL -> {{store url='page.html'}}

Contacts Page:
{{store direct_url="contacts"}}

HOMEPAGE LINK URL
{{store url=""}}  will produce: http://example.com/index.php/
<a href="{{store url=""}}">Link to Homepage URL</a>

Unsecured Base URL:
{{config path='web/unsecure/base_url'}}

Secured Base URL
{{config path='web/secure/base_url'}}


==========================IN PHTML TEMPLATES ===================
http://example.com/
<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>


http://example.com/js/
<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS); ?>


http://example.com/index.php/
<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK); ?>

<a href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK) . $product->getUrlPath() ; ?>">My Link</a>
http://popbetaserver.com/projects/mercoframes/index.php/brands/argo-equipment.html


http://example.com/media/
<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); ?>


http://example.com/skin/
<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN); ?>