问题描述
我正在开发一个新网站,为此我安装了最新版本的 Joomla,3.1.1.我使用 Twitter Bootstrap 从头开始创建了一个模板.我下载了最新版本的Bootstrap,并在我模板的index.php中加载了相关的javascript.
I am developing a new web site, for which I installed the latest version of Joomla, 3.1.1.I created a template from scratch, using the Twitter Bootstrap. I downloaded the latest version of Bootstrap, and loaded the related javascript in the index.php of my template.
在我的一个页面上创建轮播时,我遇到了轮播指示器无法反映当前图片的错误.用Firebug查了一下,发现页面加载的bootstrap.min.js不是我放在/template/xxx/js里的,而是/media/jui/js里的,是Joomla自己加载的.而 Joomla 加载的那个是旧版本.
While creating a carousel on one of my pages, I encountered a bug with the carousel indicators that were not reflecting the current picture. By investigating with Firebug, I realised that the bootstrap.min.js that was loaded on the page was not the one that I placed in /template/xxx/js, but another one in /media/jui/js, loaded by Joomla itself. And the one loaded by Joomla was an older version.
所以我将最新版本的 bootstrap.min.js 复制到/media/jui/js,我的 carousel 现在完美运行.但是(总是有一个但是),我现在有一些菜单在站点的管理端不起作用,使用默认的 Isis 模板.如果我放回旧版本的 bootstrap.min.js,它们会再次工作...
So I copied the latest version of bootstrap.min.js to /media/jui/js, and my carousel is now working perfectly. But (there is always a but), I now have some menus that don't work on the admin side of the site, using the default Isis template. If I put back the older version of bootstrap.min.js, they work again...
我想做以下两件事之一:
I would like to do one of these 2 things:
- 找到一种方法让 Joomla 为站点的管理员端和用户端加载不同版本的 bootstrap.min.js
- 找到一种方法来覆盖 Joomla 从我的模板 index.php 加载的 javascript
对如何实现其中一个目标有任何想法吗?
Any idea on how to achieve one or the other?
谢谢,帕特里克
推荐答案
你可以通过在 templates//js/jui/bootstrap.min.js
放置一个文件来覆盖媒体.但是正如 nibra 所警告的那样,您需要在 JS 中应用一些修改以保持工作正常.同样,您将使用的 JS 版本不适用于我们当前在核心中提供的内容.
You can override the media by placing a file at templates/<your_template>/js/jui/bootstrap.min.js
. But as warned by nibra, there are some modifications in the JS that you'll need to apply in your environment to keep things working. As well, you'd then be using a version of the JS that isn't intended for what we're shipping in the core currently.
因此,完全可以做到这一点,但存在相当大的风险.
So, it's possible to cleanly do it, but there's a fair amount of risk involved.
这篇关于Joomla 加载的旧版引导程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!