I am newbie to the magento
. I am developing a module. For that I have some css
andjs
files that I want to display links. I currently have the links like
<link rel="stylesheet" type="text/css" href="<?php echo $this->getSkinUrl('module_tryouts/css/jquery.fancybox-1.3.1.css');?>" media="all" />
<link rel="stylesheet" type="text/css" href="<?php echo $this->getSkinUrl('module_tryouts/css/jquery-ui-1.8.custom.css');?>" media="all" />
But after going through some of the links I came to know that the link should be secure so that the module can be integrated with mazebridge.
http://jagdeepbanga.com/blog/magento-get-base-url-skin-url-media-url-js-url-store-url-and-current-url.html
http://www.webdosh.net/2011/04/magento-get-skin-url-get-media-url-get.html
http://www.magentocommerce.com/boards/viewthread/7894/
http://www.yireo.com/tutorials/magebridge/integrations/1213-integrating-magebridge-with-other-magento-extensions
So can someone kindly tell me how to solve this issue? How to give a secure links to the files of js and css, images so that it can be integrated with mazebridge. Any help and suggestions will be really appreciated. Thanks
Below URL Access list
Base URL:
{{base url=''}}
Store URL:
{{store url='test.html'}}
also only store URL
{{store url=""}}
Media URL:
only get media URL
{{media url=''}}
if you get some folder path
{{media url='imagefolder/imagename.jpg'}}
Skin URL:
{{skin url='images/imagename.jpg'}}
only get skin URL
{{skin url=''}}
Get Base Url in magento:
$baseurl = Mage::getBaseUrl();
Get Base Url without index.php
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
// output: http://example.com/
Current Url
$currentUrl = Mage::helper('core/url')->getCurrentUrl();
or
$currentUrl = Mage::getUrl('*/*/*', array('_current' => true));
or
if (!in_array(Mage::app()->getFrontController()->getAction()->getFullActionName(), array('cms_index_noRoute', 'cms_index_defaultNoRoute')))
{
$currentUrl = Mage::helper('core/url')->getCurrentUrl();
}
Skin URL:
$skinUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);
Unsecure Skin URL:
$skinUrl = $this->getSkinUrl('images/imagename.jpg');
Secure Skin URL:
$this->getSkinUrl('images/imagename.gif', array('_secure'=>true));
Media URL
$mediaUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
or
$mediaUrl = Mage::getBaseUrl('media');
Get Js URL:
$jsUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);
or
$jsUrl = Mage::getBaseUrl('js');
get store URL:
$storeUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
Get Home URL:
$homeUrl= Mage::helper('core/url')->getHomeUrl();
Get Directory paths
Mage::getBaseDir('design') // Get design directory path
Mage::getBaseDir('code') // Gives code directory file path
Mage::getBaseDir('lib') // Gives lib directory file path
Mage::getBaseDir('skin') // Gives skin directory file path
Mage::getBaseDir('var') // Gives var directory file path
Mage::getBaseDir('cache') // Gives cache directory file path
Mage::getBaseDir('log') // Gives log directory file path
Create module URL:
Mage::getUrl('module/controller/action');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With