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.
Bootstrap comes with 180 icons (glyphicons) in form of ttf, svg and woff files. Old one only has 140.
Old bootstrap used sprite image, so
'render' => 'sprite'
should probably change, but I don't know to what.
New bootstrap needs glyphicon class so I implemented this hook: bootstrap_preprocess_icon (why aren't preprocess functions called from included files? I had to put it template.php to get it working...). I don't know if it's the proper way to do that.
Comment | File | Size | Author |
---|---|---|---|
#8 | bootstrap-update-icons-2073723-new.patch | 15.39 KB | kslonka |
#2 | bootstrap-update-icons-2073723.patch | 16.34 KB | kslonka |
icons.patch | 15.42 KB | kslonka | |
Comments
Comment #1
markhalliwellPreprocess functions aren't called from icons.inc because that file is loaded only when needed with the Icon API. This is to help not bloat the memory footprint, so putting the preprocess function in template.php is required, yes.
A few minor issues:
I know that the glypicons are now font based. They should remain "sprite" (which just means CSS). I'm not sure though if maybe we need to also figure out a way to disable them if the "font" directory is not detected. Maybe wrap the entire hook_icon_bundles() in an if?
All the icons and this line have whitespace at the end of the line. Please remove them. Also I would recommend downloading and installing Dreditor and view the above patch for yourself to see how quickly these are discovered :)
Comment #2
kslonka CreditAttribution: kslonka commentedRemoved whitespace and prepared if statement.
Comment #3
markhalliwellA sub-theme may actually have their own fonts, we need to specifically check whether glyphicons exists (with using Drupal to find the theme path, this assumes we know it's in sites/all/themes). Here is what I'm thinking (not tested, just wrote here. PS: the variable should be named $cdn):
Comment #4
markhalliwellAny chance to work on this?
Comment #5
kslonka CreditAttribution: kslonka commentedOnce I finish other projects I will :)
Comment #6
ionmedia CreditAttribution: ionmedia commentedis now a way to use font icons with cdn enabled by default ?
Comment #7
kslonka CreditAttribution: kslonka commentedMark: Can you write what needs to be done, before this gets commited?
Comment #8
kslonka CreditAttribution: kslonka commentedTested and should be working.
Comment #9
markhalliwellThanks @kslonka!
Committed 33a1d6e to 7.x-3.x.
Committed 9425e4f to 7.x-3.x.
Comment #10
kslonka CreditAttribution: kslonka commentedMark: While doing this I found a bug in less files, more info: https://drupal.org/node/2071975#comment-7880609 could you reopen that issue?
Comment #11
markhalliwell