Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Get Root URL
 
DCAlmeida
Sr. Member
 
Avatar
Total Posts:  164
Joined:  2008-12-28
PRT
 

Hi!

I also tried some functions like <?php echo Mage::getURL('') ?> or <?php echo $_link->getUrl() ?> but it don´t works for my needs.

So, I explain:
- I have another root directory, a live support script. I also copy and paste html code to Magento, to show online or offline support but this works statically.
- I am trying put this image dynamically, without direct and correct URL dependency.

My actual code is inside links.phtml and is:

<script type="text/javascript" src="/websitename/support/livehelp_js.php?eo=1&relative;=Y&amp;&amp;serversession=1&amp;pingtimes=15"></script>

So, I defined /websitename like root url but my objective is the system generate the url code dynamically, independent of host.

 
Magento Community Magento Community
Magento Community
Magento Community
 
DCAlmeida
Sr. Member
 
Avatar
Total Posts:  164
Joined:  2008-12-28
PRT
 

Ah, another point:

The result of geturl is:

http://localhost/websitename/index.php//support/livehelp_js.php?eo=1&rela;

:(

 
Magento Community Magento Community
Magento Community
Magento Community
 
LeeSaferite
Guru
 
Avatar
Total Posts:  322
Joined:  2007-08-31
Lake City, FL
 

Try Mage::getBaseUrl() or $this->getSkinUrl() depending on where you keep your JS

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top