Question

Joomla 3.2.3

Hi all, I am trying to develop a plugin for Joomla (just for myself) and I have run into a problem.

Basically, the plugin searches for the URL linking to the local copy of bootstrap.min.css which is:

/media/jui/css/bootstrap.min.css

This is then replaced by a CDN version of the Bootstrap CSS.

Everything works fine when the website is located in the root of the domain but if the website is in a subdirectory then the link changes to:

/subdirectory/media/jui/css/bootstrap.min.css

And the plugin stops loading the CDN version.

Is there a PHP based way to determine if the website is being hosted in a subdirectory?

Thanks

Was it helpful?

Solution 2

I have sorted this by using

JURI::base(true);

As outlined at http://docs.joomla.org/JURI/base

OTHER TIPS

the constant JPATH_BASE gives the base directory Joomla is installed in:

http://docs.joomla.org/How_to_find_your_absolute_path

This points to the directory the index.php is located in. Which parses all requests to the joomla installation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top