Bootstrap version in 5.7?

Permalink
I've run into an js issue with a theme I'm working on. If I provide my own bootstrap js file, then the buttons in the "Design & Custom Template" block menu in edit mode stop working. (No specific error message).

If I require the C5 version, then the buttons work, but a function in my custom js file stops working. Specifically bootstrap Affix with an undefined function error in the console.

Does anyone know what version of Bootstrap latest C5 5.7 is running? Is it a modified version with some functions missing? The other possibility I wondered is whether the scripts are loading in the wrong order - is it possible to define the order the assets order?

mrjcgoodwin
 
siton replied on at Permalink Reply
siton
I believe you have "JS conflict" (in "video tut" you will see example of this kind of problem you outline).

-- C5 docs --
C5 docs --> Assets Screencast (video tut):
http://documentation.concrete5.org/developers/designing-for-concret...

Read also this - "Registering The Assets that Your Theme Provides" section:
http://documentation.concrete5.org/developers/designing-for-concret...

-- Related posts --
Mabye also this posts issues will help you:
https://www.concrete5.org/community/forums/usage/designandcustom-tem...

https://www.concrete5.org/community/forums/customizing_c5/design-and...
mrjcgoodwin replied on at Permalink Reply
mrjcgoodwin
This is what I'm getting at, but can't work out why the conflict is occurring. In theory I'm switching in like-for-lile files.

I've already got my page_theme file set up. As mentioned above if I remove my version of the bootstrap js from my code and use the C5 one then the buttons work but the Affix function becomes undefined.

So either C5's bootstrap version doesn't include this function, or my code is requiring the library before it has loaded.

I have a file with my custom js in - is there a way to define at which point this loads relative to the other scripts? Can I include a custom js file in my page_theme file?
siton replied on at Permalink Best Answer Reply
siton
"Plugins can be included individually (using Bootstrap's individual *.js files), or all at once (using bootstrap.js or the minified bootstrap.min.js)."(bootstrap docs)

So I think its really better to link only to affix.js (4k unminified). You dont need to override the complete C5 bootstrap.js libary for this small issue (or again use assets and tell the theme "use my JS version". of course in you "custom" JS version you must include the Plugins C5 use: drop down, dropdown, and so on)

I think C5 dont use affix.js Plugins (look at the list) - this is why you get error when you remove your custom js:
Assets list:http://documentation.concrete5.org/developers/appendix/asset-list...
mrjcgoodwin replied on at Permalink Reply
mrjcgoodwin
Thanks for this - you're spot on it would seem.

Hadn't seen your reply yet, but had just reached the same conclusion... the C5 version of Bootstrap JS doesn't contain the Affix plugin and I've now attached it as a separate plugin.

The thing I still don't get is why it still caused problems with the C5 interface when I set page_theme to provide my own bootstrap js file as an override. The only thing I can think is there is some kind of version conflict - perhaps C5 is using an older version or my version wasn't the full version (I thought it was but likely not).

Thanks for your help - got there in the end and lesson learnt about what is/isn't included in C5 package.