1

I'm using drupal 7 and I simply don't want jQuery included at all. It seems like most people are advocating modify the js in a theme hook. That's fine I suppose, but it seems like this is dangerous and a little silly.

If we're removing jQuery after something has requested it, won't that break whatever requested? How can I find out what is requiring jQuery?

Related to that is all the system CSS files that are included by default. I've also found that using a theme hook to get rid of them is the way to go. It seems like Drupal has a lot of "features" like this that require you to add more code to remove things. It seems like there should be a more efficient way to handle things like this. (forgive me if I'm mistaken, I'm coming from years of work with frameworks and not a full stack CMS).

In the end, what I want is a theme that has NOTHING in it except what I explicitly say should be there. Right now I'm considering just writing the html.tpl.php to not use the dynamic drupal variables.

3

I think that it is pretty safe to assume that any module using JS is going to assume that jQuery is present. Yes they should feature detect this, but its availability in Drupal is pretty much assumed by everyone. There is no real way to get a list of all of the jQuery dependencies.

CSS can be aggregated and minified if the worry is file count.

If you truly want to manage these yourself, your best bet is to remove the $scripts and $styles variables from html.tpl.php and manage your own, eg $myscripts and $mystyles. You could also unset/reset them in your own template_process_html.

Drupal is built on hooks. Don't think of it as having to add code to remove something. You add code (implement hooks) as a way to modify or extend the default behavior.

Now that I have answered your question, you are really going out of your way to bypass a lot of the power of Drupal. You should start by looking into what Drupal calls starter themes or base themes. The Omega and Zen themes are two popular ones.

  • thank you for that input. this is very helpful. Like I said, I'm coming from building sites from a framework. The overhead (in terms of API/coding) needed for drupal is a bit overwhelming. It won't let me do anything on my own. It really wants me to do what it thinks best (not that it isn't best, it's just quite the learning curve). – gregghz Oct 28 '11 at 20:09
  • as an example of what is so overwhelming: The Zen theme has its own "Extensive documentation" .... I just want to write some html and javascript. – gregghz Oct 28 '11 at 20:17
  • do you have a recommendation of Omega or Zen? On first impression, Zen seems more flexible, but I could be wrong. – gregghz Oct 28 '11 at 20:24
  • I have been programming for over 25 years now. Yes, Drupal is a little overwhelming, but at this poing in my professional progression, I can appreciate the thought that has gone into Drupal and not have to worry about implementing things again, even when starting with a proper framework. I have come to appreciate the consistency with from project to project. – mpdonadio Oct 29 '11 at 0:42
  • I use Zen for Drupal 6, but Omega for Drupal 7. Of the two, I like Omega better. A lot of it is the way it handles the 960 Grid, and the zone/region management from the UI. I can do all of it manually, but it makes it easier for my graphics peeps to do setup, so I can concentrate on more complicated coding issues. – mpdonadio Oct 29 '11 at 0:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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