0

I'm currently building a custom theme from the ground up on drupal on localhost.

At the moment I've managed to add my theme and run my custom templates succesfully. However I can't get it to pick up my CSS or JS files.

These were the lines in my .info file

stylesheets[all][] = /css/main.css
scripts[] = javascript/javascript.js

However I got an error in the console saying:

'GET http://localhost/drupal/css/main.css 404 (Not Found)'

So I modified the path of the css and js files to something like this:

stylesheets[all][] = sites/all/themes/THEMENAME/css/main.css

Yet it still can't find it. I'm not sure what's going on. Has the .info file been cached?

1 Answer 1

1

May be the problem is of / present at the starting in your first attempt(/css/main.css), try once with:

stylesheets[all][] = css/main.css

Note: Clear the cache and check if it works.

Also you can check the following links if it helps:
https://drupal.org/node/171205
https://drupal.org/node/171209

1
  • Yeah, I'd also neglected to take out all the css and js files I'd included in the head of template which was also spitting out a lot of errors!
    – Joe Taylor
    Oct 18, 2013 at 22:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.