• Get Paths and URLs in phtml files

    Usage Snippet
    This snippet is best used within your .phtml templates within magento so you aren’t hardcoding links
    <?php
    echo Mage::getUrl('contact-us/');
    ?>
    Get Base URL
    <?php
    echo Mage::getBaseUrl();
    ?>
    Get Skin URL
    <?php
    echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);
    ?>
    Get Media URL
    <?php
    echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
    ?>
    Get JS URL
    <?php
    echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);
    ?>
    Get Current URL
    <?php
    echo Mage::helper('core/url')->getCurrentUrl();
    ?>

    Discover more from Linchpin

    Subscribe to get the latest posts sent to your email.