I have several Joomla 3.9 websites now using Bootstrap 4x - currently v4.1.3.

In the head of the index.php file for each website is this link:

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">

and in the bottom of the index.php are these three scripts:

<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous" async></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous" async></script>

(Note: I am using jquery-3.3.1.min.js instead of the slim version as the slim version does not include scrollTop and other animation functions)

When Bootstrap 4.1.3 is updated to the next version I would prefer not to have to go into each template and update all four links manually for each site. (Each template is different).

What I would like to do is upload two files to a subdomain, e.g. files.mydomain.co.uk, one containing the link to the stylesheet and the other containing the three scripts. I would then add links to those files in the index.php. Something like this:

<link rel="stylesheet" href="https://files.mydomain.co.uk/bootstrap-min-css.php">

which is a file containing the stackpath.bootstrapcdn.com stylesheet link

and for the three scripts just before the closing body tag:

<link href="https://files.mydomain.co.uk/bootstrap-required.php">

If it worked, I'd only have to update the link once each update. I've tried it, but (probably not surprisingly) it doesn't work.

Question 1: is what I want to do possible?

Question 2: if yes, how?

Question 3: will Joomla 4x contain all these files, anyway? If so, I can probably manage until then.

Thank you.

p.s. Can someone with the appropriate reputation please add a tag for Bootstrap 4x? Thank you.

  • Cdn's sometimes provide a link to the latest version rather than defining the link in the URL. Perhaps use that instead – Lodder Nov 12 '18 at 17:04
  • Thanks @Lodder. I will see if that type of link is available and report back if it is or not – Gillian Nov 13 '18 at 18:40
  • Apparently it's a bad idea to do so: blog.jquery.com/2014/07/03/dont-use-jquery-latest-js – Lodder Nov 13 '18 at 18:43
  • Thank you, again, @Lodder. It seems that Bootstrap doesn't offer this facility anyway, so I'll have to cross my fingers that Joomla 4x will include these files in its core when it's launched. I think you should put your comment as an answer and I'll accept it as such. Thank you. – Gillian Nov 15 '18 at 9:35
  • Being one of the old developers for Joomla 4 but still actively looking over it's development, I can tell you for sure that Joomla 4 will ship with jQuery 3 and Bootstrap 4. jQuery won't actually be used in core but will still be shipped for its users. – Lodder Nov 15 '18 at 9:43

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.