Jump to content

To Substitute CSS-JS


Recommended Posts

Hello, I went in this tutorial where Joss Sanglier says to put the new folders of CSS-JS directly inside the folder templates of PW. With ftp. I did it. The guide also says to add:

<link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates; ?>css/bootstrap.min.css" />

for the css.

and for the js:
 

<script type="text/javascript" src="<?php echo $config->urls->templates; ?>js/bootstrap.min.js"></script>

 

but I did not understand exactly WHERE I must add it.

Perhaps in the Processwire's index.php file?

Perhaps within the file of the template that I am using?

Perhaps inside the new folders CSS-JS? If so,  WHAT I must substitute?

I would like to understand if the replacement of CSS/JS standard processwire by a plane CSS-JS that I choose by internet, is an operation that I can do well, or I must pay a professionist.

 

Thanks

Francesco

Link to comment
Share on other sites

Hello Francesco,

it depends on how you structure your files and directories.  There is no general rule for it. Thats the best on PW because you can do all on your own.

You have to include it usually in your head.inc file if you are using Joss tutorial as your starting point. The head.inc usually include all the meta data from the head section and there you can add these lines of code.

If you are using Bootstrap css and js files I would prefer to load those files from a cdn (fe jsdelivr or Bootstrap CDN) instead from local copies.

Best regards Jürgen

  • Like 1
Link to comment
Share on other sites

@franciccio-ITALIANO 

Hi,

You might want to refer to this:

http://getbootstrap.com/getting-started/#template

As a rule of the thumb, we should have the browser load our JS files at the end of the HTML document (right before </body>). Except, when there is a good reason for not doing so. :)

Google search: where to load javascript in html file

As Juergen pointed out, this is not really ProcessWire issue, but – in this particular case – a Bootstrap one. (tip: when using a css framework, refer to its docs first)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...