?
avatar maofree
maofree
24 Dec 2013

hi
I want to decide by myself which files are loaded into the header
you load jquery 1.10.2 but it is not min version
and you load bootstrap.js file, but I want to use the jquery file from google website and the min version; and use bootstrap v.3 the min version
Now for jquery I'm forced to use the file presents in media/ui/ and for bootstrap both versions the 2.3.2 and my 3.0.3
In some cases I need to use jquery 1.8.3 to use a particolar slideshow or carousel.
Your strategy gives problems with joomla's upgrades

Can I remove these limitations?

thanks

avatar maofree maofree - open - 24 Dec 2013
avatar zero-24 zero-24 - close - 24 Dec 2013
avatar Bakual
Bakual - comment - 24 Dec 2013

You can override each of these files within your template if you wish. And there are also plugins on JED which allow to mess around with JavaScript files.

Closing as not a bug.

avatar Bakual Bakual - change - 24 Dec 2013
The description was changed
Description <p>hi<br> I want to decide by myself which files are loaded into the header<br> you load jquery 1.10.2 but it is not min version<br> and you load bootstrap.js file, but I want to use the jquery file from google website and the min version; and use bootstrap v.3 the min version<br> Now for jquery I'm forced to use the file present in media/ui/ and for bootstrap both versions the 2.3.2 and my 3.0.3<br> In some cases I need to use jquery 1.8.3 to use a particolar slideshow or carousel.<br> Can I work around these limitations?</p> <p>thanks</p> <p>hi<br> I want to decide by myself which files are loaded into the header<br> you load jquery 1.10.2 but it is not min version<br> and you load bootstrap.js file, but I want to use the jquery file from google website and the min version; and use bootstrap v.3 the min version<br> Now for jquery I'm forced to use the file presents in media/ui/ and for bootstrap both versions the 2.3.2 and my 3.0.3<br> In some cases I need to use jquery 1.8.3 to use a particolar slideshow or carousel.<br> Your strategy gives problems with joomla's upgrades</p> <p>Can I remove these limitations?</p> <p>thanks</p>
Status New Closed
Closed_Date 0000-00-00 00:00:00 2013-12-24 08:00:18
avatar Bakual Bakual - close - 24 Dec 2013
avatar maofree
maofree - comment - 24 Dec 2013

thaks Bakual
Can you explain me how to override some js files from a template?

avatar Bakual
Bakual - comment - 24 Dec 2013

As an example the jQuery and assuming you use the Protostar template (otherwise adjust the template folder). Put it to /templates/protostar/js/jui/jquery.min.js
Also note that if you have debug enabled, it will not load the .min version but the normal one.

avatar maofree
maofree - comment - 24 Dec 2013

thaks Bakual
it works

avatar maofree
maofree - comment - 24 Dec 2013

with
$doc->addScript("http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js");
I can add jquery from google's servers, but the override doesn't work
In the next versions is it possible to have this feature?

bye

avatar Bakual
Bakual - comment - 24 Dec 2013

The overrides only work if you use JHtml::Script('path/to/script.js', false, true). See the excellent post from Michael for more explanations: http://www.babdev.com/blog/139-use-the-media-folder-allow-overridable-media
I don't think it works for external files however.

avatar maofree
maofree - comment - 24 Dec 2013

thanks

avatar maofree
maofree - comment - 24 Dec 2013

I've done some tests and I've seen that JHtml::script doesn't work with jui files.
If I put jquery.min.js into my_theme/js/jui/... the override will work. Now I can use from index.php this line
$doc->addScript($this->baseurl . '/templates/' . $this->template . '/js/jui/jquery.min.js', 'text/javascript');
but inside the head tag I'll get just one line so this method looks if there is already this file

bye

avatar Bakual
Bakual - comment - 24 Dec 2013

As for feature request: We currently track those in our feature tracker: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemBrowse&tracker_id=8549
Feel free to open an item there if you think it's a needed feature. If someone writes the code for it, it can then be considered for implementation.

avatar Bakual
Bakual - comment - 24 Dec 2013

I've done some tests and I've seen that JHtml::script doesn't work with jui files.

It works. But you are doing it wrong.
May I ask you to go to the forums (http://forum.joomla.org) or Google Groups (https://groups.google.com/forum/#!forum/joomla-dev-general) to get further guidance how to use this feature?
Because this here isn't a support forum, it's meant for bugtracking only.

avatar maofree
maofree - comment - 24 Dec 2013

I try to use this code
<?php
echo JHtml::script($this->baseurl . '/templates/' . $this->template . '/js/test.min.js', false);
?>
like of
http://docs.joomla.org/Adding_JavaScript_and_CSS_to_the_page
I've seen that there are two versions

I don't want to stress you
for now I'm ok with the previous override solution

avatar zero-24 zero-24 - change - 7 Jul 2015
Labels Added: ?

Add a Comment

Login with GitHub to post a comment