Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Blueprint suffers from the common problem that upgrades (especially via drush) tend to wipe the framework directory, breaking sites and necessitating a re-download. The Libraries API project has solved this problem. I'd be happy to submit a patch if y'all are open to using it, but don't want to waste my time if not. Please advise.
Comment | File | Size | Author |
---|---|---|---|
#11 | blueprint_libraries.patch | 5.36 KB | designerbrent |
#8 | blueprint.patch | 1.09 KB | seanr |
#7 | blueprint.patch | 1.65 KB | seanr |
Comments
Comment #1
designerbrent CreditAttribution: designerbrent commentedI'd be interested in learning more about how this would work. What changes would be required in the code? Does that mean the theme would then become dependent on the Libraries API module?
Comment #2
acrollet CreditAttribution: acrollet commentedHi there,
sorry, I forgot to subscribe to this queue, and only just checked back. Blueprint would indeed become dependent on the libraries API, here's the howto: http://drupal.org/node/735160
Comment #3
acrollet CreditAttribution: acrollet commentedPlease see also: http://drupal.org/project/jquery
thanks,
Adrian
Comment #4
designerbrent CreditAttribution: designerbrent commentedI looked though the documentation for Libraries and while the concept looks interesting, I'm not sure I'm ready to introduce a module dependency into Blueprint as it will require a bit of additional custom code to account for the possibilities of the module missing since the "dependencies[] = libraries" tag doesn't work for themes, only modules.
If I'm missing the "how" on getting this done, i'd be interested here how it should be done and how it works with Themes, not just modules.
Comment #5
acrollet CreditAttribution: acrollet commentedHi there,
I can definitely sympathize with the dependency issue. I'm wondering if you would be willing to do one of two things:
a) use module_list() to check if the libraries API module is present and enabled, and if so check the libraries directory for blueprint if it's not present in the blueprint module's dir.
b) have an optional configuration setting that gives an alternate path to the library, stored in a variable.
Again, I'd be happy to code up a patch for either if you're open to the idea.
thanks,
Adrian
Comment #6
designerbrent CreditAttribution: designerbrent commentedI'd certainly be interested if you want to code it.
Comment #7
seanrJust wrote a patch that appears to work fairly well. I'd love to see this get in. We have to refetch the dependencies every time we update a site - very annoying.
Comment #8
seanrUgh, just read #5, attached patch fixes that by using module_exists.
Comment #9
designerbrent CreditAttribution: designerbrent commentedThanks seanr for the patches and acrollet for pushing this. I'm ready to do something about it soon. As it sits now, running drush updates causes the problem of deleting the Blueprint library folder when it is contained in the blueprint folder structure.
After giving it a bunch of thought and looking over the code of both the patches and the Libraries API module, what advantage do I gain by calling the Libraries module vs just looking in sites/libraries/* for the blueprint folder? It seems like less overhead to do that but I'd be happy to consider making use of the Libraries API. Am I missing some advantage?
Comment #10
acrollet CreditAttribution: acrollet commentedThe biggest advantage I can think of right off is not having to hardcode paths - for one thing, libraries can exist in any of the following places: (and probably more)
sites/default/libraries
sites/all/libraries
profiles/{profile_name}/libraries
sites/com.example.www/libraries
thanks,
Adrian
Comment #11
designerbrent CreditAttribution: designerbrent commentedOk, so here is what has been done:
So while Blueprint will now support Libraries API, it is not required.
I'm attaching the patch of the changes made and am open to comments but will be committing it shortly as soon as I get it documented.
Comment #12
designerbrent CreditAttribution: designerbrent commentedOpps. got the wrong status tag. I would love to have some of you look at it and am open for changes.
Comment #13
seanr#11 looks pretty good to me.
Comment #14
susheel_c CreditAttribution: susheel_c commentedsubscribing... Will try this out on a fresh install in a day or two.
Comment #15
joelstein CreditAttribution: joelstein commentedOne thing I noticed is that the IE stylesheet needs the $base_path prepended. So, in page.tpl.php...
...should be...
Comment #16
designerbrent CreditAttribution: designerbrent commentedThanks for catching that joelstein. I have committed that back to the Dev line.
Comment #17
joelstein CreditAttribution: joelstein commentedWhile we're still on this issue... on one of my projects, our designer built the design using a customized version of the Blueprint library (via Boks). In this case, it makes sense to keep the blueprint files within the sub-theme.
Is it possible to add one more check for the location of the Blueprint theme? I don't believe Libraries API will do this for us (the closest it gets is sites/default/libraries).
Comment #18
Jon Nunan CreditAttribution: Jon Nunan commentedDoesn't this break the idea of being able to override any css file in the theme by simply declaring it in a sub-theme's .info file?
The following checks for over riding screen.css and print.css in the sub-themes 'css' directory before adding the library versions.