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
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 |
thaks Bakual
Can you explain me how to override some js files from a template?
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.
thaks Bakual
it works
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
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.
thanks
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
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.
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.
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
Labels |
Added:
?
|
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.