扩展,修改或覆盖Joomla的bootstrap.php?(Extend, modify, or override Joomla's bootstrap.php?)

编程入门 行业动态 更新时间:2024-10-25 18:36:08
扩展,修改或覆盖Joomla的bootstrap.php?(Extend, modify, or override Joomla's bootstrap.php?)

所以我一直在玩Bootstrap的Joomla 3。 起初我并没有完全理解Bootstrap被融入CMS的意思 - 似乎你可以调用它但是必须使用Javascript或模板覆盖来匹配预期的输出。 比手动调用Bootstrap框架更方便。

然后我找到了一些关于libraries/cms/html/bootstrap.php - 并且有很多欢欣鼓舞:

http://doc.joomladev.eu/api3/Joomla-Libraries/HTML/JHtmlBootstrap.html ; https://groups.google.com/group/joomla-dev-cms/browse_thread/thread/59ede023a635cc78/18f67450a08e66ff?lnk=raot ; http://itprism.com/blog/106-bootstrap-tabs-accordion-slides 。

这似乎是一项正在进行的工作,我发现的有限链接表明有一些问题需要解决。 但对于前进有用...特别是如果我可以根据需要创建或编辑我自己的。

有没有办法在模板覆盖中使用此文件,如modules.php? 有没有比我上面列出的更好的文档?

谢谢!

So I've been playing with Joomla 3 with Bootstrap. At first I didn't fully understand what they meant by Bootstrap being baked into the CMS - seems like you could call it but would have to either use Javascript or template overrides to match the expected output. Not much more convenient than calling the Bootstrap framework manually.

Then I found a few links about libraries/cms/html/bootstrap.php - and there was much rejoicing:

http://doc.joomladev.eu/api3/Joomla-Libraries/HTML/JHtmlBootstrap.html; https://groups.google.com/group/joomla-dev-cms/browse_thread/thread/59ede023a635cc78/18f67450a08e66ff?lnk=raot; http://itprism.com/blog/106-bootstrap-tabs-accordion-slides.

This seems to be a work in progress, and the limited links I found indicate that there are some kinks to be worked out. But useful for going forward...especially if I can create or edit my own as needed.

Is there a way of using this file in a template override, like modules.php? Is there any better documentation than what I listed above?

Thanks!

最满意答案

作为JHtml帮助程序,您可以像在CMS中看到的任何其他JHtml调用一样使用它。 你可能知道, JHtml::_('behavior.framework'); 在CMS中启用MooTools。 好吧,有一个类似的函数JHtml::_('bootstrap.framework'); 这将加载Bootstrap JavaScript及其jQuery依赖项。 所以,如果你想启用Bootstrap的警报插件,只需调用JHtml::_('bootstrap.alert', 'optionalClassNameForAlertElements'); 你已经准备好了。

Bootstrap在CMS中的使用时间不到一年,而MooTools已经存在了一段时间,所以显然支持仍然可以得到改善。 但是,我们已经尝试过快速启用各种Bootstrap JavaScript插件,以便您可以专注于前端工作。

As a JHtml helper, you would use it like any other JHtml call you see in the CMS. As you probably know, JHtml::_('behavior.framework'); enables MooTools in the CMS. Well, there's a similar function JHtml::_('bootstrap.framework'); that will load the Bootstrap JavaScript as well as its jQuery dependency. So, if you want to enable Bootstrap's alert plugin, just call JHtml::_('bootstrap.alert', 'optionalClassNameForAlertElements'); and you're all set.

Bootstrap has less than a year in the CMS while MooTools has been around for a while, so obviously the support can still be improved upon. But, we've tried to make it easy to quickly enable the various Bootstrap JavaScript plugins so you can focus on front-end work.

更多推荐

本文发布于:2023-07-24 19:33:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1250162.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:php   bootstrap   Joomla   override   modify

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!