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://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 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

  1. base url:

    {{base url=''}} 
  2. store url:

    {{store url='test.html'}} 

    also store url

    {{store url=""}} 
  3. media url:

    only media url

    {{media url=''}} 

    if folder path

    {{media url='imagefolder/imagename.jpg'}} 
  4. skin url:

    {skin url='images/imagename.jpg'}} 

    only skin url

    {skin url=''}} 


get urls in php files (incl. templates/phtml)

  1. 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/ 
  2. 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(); } 
  3. 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)); 
  4. media url

    $mediaurl = mage::getbaseurl(mage_core_model_store::url_type_media); 

    or

    $mediaurl = mage::getbaseurl('media'); 
  5. get js url:

    $jsurl = mage::getbaseurl(mage_core_model_store::url_type_js); 

    or

    $jsurl = mage::getbaseurl('js'); 
  6. get store url:

    $storeurl = mage::getbaseurl(mage_core_model_store::url_type_web); 
  7. get home url:

    $homeurl= mage::helper('core/url')->gethomeurl(); 
  8. 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 
  9. create module url:

    mage::geturl('module/controller/action'); 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -