Code: Select all
<?php echo "baseurl"; ?><?php echo $this->baseurl; ?>
Amy
Code: Select all
<?php echo "baseurl"; ?><?php echo $this->baseurl; ?>
Code: Select all
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css" type="text/css" />
Code: Select all
<link rel="stylesheet" href="http://example.com/templates/system/css/system.css" type="text/css" />
Code: Select all
<link rel="stylesheet" href="/templates/system/css/system.css" type="text/css" />
Thanks!qson wrote: I found out that the call that sets $this->baseurl isand this returns an empty string. I don't know why it doesnt work. Did not study the JURI::base()-function. Though if called with no arguments it works, so for the moment I use in the template instead of $this->baseurlCode: Select all
JURI::base(true);
Maybe this should be considered a bug? ( I mean the JURI::base(true); returns an empty string while JURI::base(); returns correct base)
to get the correct path.define("JURL_BASE", JURI::base());
If Joomla! is installed on the root of you domain (http://domain.com/), then $this->baseurl is empty, and that is correct.pvh123 wrote: The discussion was that $this-> baseurl delivered an empty string, so nopath is set.
But some paths in templates, components etc. is relative (not starting with "/"), which kills the SEF url (eg. /component/contact/component/contact/index.php?option=com_contact)jenscski wrote: If Joomla! is installed on the root of you domain (http://domain.com/), then $this->baseurl is empty, and that is correct.
Thanks, Johan. Since this comes from "the horses mouth" I can at least advice the complete answer next time.Jinx wrote: Hehe, confusion all around it seems. The $this>->baseurl was added right before RC3 and hold the site basepath, or subdirectory for non developers among you. If you site is installed in the root then it's empty indeed.
If you use JView to render your module templates you can use baseurl too .This would be the adviced approach.hsm wrote: Why exists baseurl only for a joomla-template and not for a module-template?
Code: Select all
<a href="<?php echo $this->baseurl; ?>">Logo</a>
Code: Select all
<a href="<?php echo $this->baseurl; ?>/">Logo</a>
It does at least work for me . Because I am linking 2 or 3 templates together, depending on the subject of that part of the site, I was struggling "to find the way home' again.$this->baseurl
The baseurl should find its proper path automatically relative to the root of the site, whether in a folder or not.richrc1131 wrote:Where can I find the baseurl parameter? I am building a site within a folder on the original site and need to get the css working, but I don't know where to set the base url.
Code: Select all
<img src="<?php echo $this->baseurl ?>/modules/mod_JTPlogin/manicon.gif" alt="<?php echo JText::_('Username') ?>" width="25" height="25" border="0" />