BS5 in Joomla 4 #32350
-
Imo, Bootstrap brings a huge load of payload As with j!3 I want to be in control of what I am using for my templates. Will I still be able to cut the BS and use this in my template?
|
Beta Was this translation helpful? Give feedback.
Replies: 11 comments 4 replies
-
Did you try? |
Beta Was this translation helpful? Give feedback.
-
Cannot give you specific code but surely you can do it using Web Assets API (method disableAsset). Please read https://docs.joomla.org/Special:MyLanguage/J4.x:Web_Assets to see how to use Web Assets API . |
Beta Was this translation helpful? Give feedback.
-
J4 is modular, there is no concept of one bootstrap.js. You can load each interactive component per view
Please don't do that if your extension/template is something that others will ever use. You're breaking interoperability and it's kinda awful. If it's an ext/template for your own use it's fine as long as you know what you're doing (in this case the unset trick will not work as the assets are loaded with the Assets Manager so you have to unload them using that. @joomdonation already shared the link with the docs). |
Beta Was this translation helpful? Give feedback.
-
So, in reality we get BS forced upon us now... where in J3 we could get rid of it, now in j4 we can't anymore..? in assets manager docs I don't see an unload, disable or do not use feature nor do I see a reference to bootstrap so it is harder coded than in this Asset Manager... |
Beta Was this translation helpful? Give feedback.
-
If this is what you understood from what I wrote, you totally got it wrong
No, it's not it's again just a 1 line (per component, there is no Bootstrap.js anymore as I explained above): // Will not load the Bootstrap Collapse
Factory::getDocument()->getWebAssetManager()->disableScript('bootstrap.collapse'); FWIW you shouldn't use jQuery |
Beta Was this translation helpful? Give feedback.
-
thank you for that sample i apparently totally overlooked. Will test it. Tx. Regarding the use of jQuery... nice if you are only using J! only. Since even BS5 cannot sort a table dynamically in a (pre)defined manner. Lucky it still gets shipped, even though I am using the latest from jQuery and not the one shipped with j!3. FWIW..there is also plenty of arguments against the use of BS... |
Beta Was this translation helpful? Give feedback.
-
Haha, a couple of years ago I (together with few others) was fighting so that the project would decouple from Bootstrap. We were ignored. I guess with Bootstrap 6 that will move all the interactive components to Web Components they will reconsider
I consider myself doing quite some interactive experiences ( https://perfectgrid.io/demo ) and haven't used jQuery for quite some time |
Beta Was this translation helpful? Give feedback.
-
@dgrammatiko the use for somewhat complex tables with sorting I why I use jQuery. when working sports results there is more sort ordering than just alphanumeric.. using jQuery does allow me to sort these too. Will explain one sample: in sports sailing race results there are various scoring values, numbers, 1, 2, 3 and on for first, second, third.. upto the amount of boats participating (amount of participators +1 for the DSQ, disqualified) Importing such a results table with all values is not an issue.. I have a plugin that can translate several types into HTML... sorting them in the browser however in the way expected is not possible with the usual BS or any other grid system... Since several special stuff like this can be in a site, working with jQuery is needed (or another library is).. the grid systems like BS or any other lack the possibility and I have to add something anyway.. so if jQuery is already there, why not us it for all? |
Beta Was this translation helpful? Give feedback.
-
NO, that's a very wrong assumption. It's 2021 you can do without jQuery. I'm guessing https://sortablejs.github.io/Sortable/ is a good replacement to whatever you're using right now. Anyways if jQuery works for you then fine. I think this issue can be closed as your question was answered |
Beta Was this translation helpful? Give feedback.
-
Been there cannot do.. sorry maybe little lost in translation... but english is not my native.. read sorting as in in sort ordering This shows some sample where "good", "medium" and "bad" are valued for sorting.. I am doing this ordering for race results, others will do maybe for there ecommerce product pages.. using a library jQuery or any other just is usefull for a lot of sites.. though I can see the bunch can do without, there are just these specifics that need... and there are also people that utterly just dislike BS. (oops, maybe me...) That someone can do without jQuery in 2021 is fine.. but is also nice to have just one library for all your needs instead of reinventing wheels over and over for each added browser interactivity... and that doesn't need to be jQuery, can be something else, but BS just doesn't have it. And as with the first BS versions I expect it to be a heck of a job to style it in a way it doesn't look like the next website.. :( |
Beta Was this translation helpful? Give feedback.
-
Whatever, as I said you can use whatever you want, I'm not judging just saying that there are better tools. Anyways can you close this as there is no issue with the core for this? |
Beta Was this translation helpful? Give feedback.
If this is what you understood from what I wrote, you totally got it wrong
No, it's not it's again just a 1 line (per component, there is no Bootstrap.js anymore as I explained above):
FWIW you shouldn't use jQuery