magento Get Base Url , Skin Url , Media Url , Js Url , Store Url and Current Url for secure -
i newbie magento
. developing module. have css
andjs
files want display links. have links
<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 of links came know link should secure module can integrated mazebridge.
http://www.webdosh.net/2011/04/magento-get-skin-url-get-media-url-get.html
http://www.magentocommerce.com/boards/viewthread/7894/
so can kindly tell me how solve issue? how give secure links files of js , css, images can integrated mazebridge. , suggestions appreciated. thanks
below url access list
get urls in cms pages or static blocks
base url:
{{base url=''}}
store url:
{{store url='test.html'}}
also store url
{{store url=""}}
media url:
only media url
{{media url=''}}
if folder path
{{media url='imagefolder/imagename.jpg'}}
skin url:
{skin url='images/imagename.jpg'}}
only skin url
{skin url=''}}
get urls in php files (incl. templates/phtml)
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') // 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');
Comments
Post a Comment