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.
Instead of local libraries I would like to use the css from the CDN.
Comment | File | Size | Author |
---|---|---|---|
#12 | add_support_for_cdn-2427075-12.patch | 900 bytes | mkhamash |
Comments
Comment #1
wroxbox CreditAttribution: wroxbox commentedChanged preprocess_page into hook_page_build and added CSS from CDN.
Comment #2
wroxbox CreditAttribution: wroxbox commentedFixed to latest CDN version.
Comment #3
wroxbox CreditAttribution: wroxbox commentedComment #4
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedCould there be a switch where an admin can decide which s/he would like with a local library fallback much like jquery_update?
Comment #5
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedComment #6
markhalliwellThis completely replaces the ability to provide a local version.
Comment #7
mkhamash CreditAttribution: mkhamash at Vardot commentedHere is patch that will give the ability to choose between a local and a CDN version of Font Awesome, it adds a checkbox to Drupal Bandwidth optimization settings in performance page, I am not convinced with the place of the checkbox but this is the best place that I could find.
Comment #8
aDarkling CreditAttribution: aDarkling as a volunteer commentedWorks great!
Tried it with css/jscript aggregation on & off.
Code looks good. You might want to compress lines 20-22 to
$requirements['fontawesome']['title'] = $fontawesome['name'];
for code readability consistency, especially since the array was already explicitly defined on line 12.
However that is just a personal style opinion & does not affect the operation of this patch in the least.
Comment #9
inders CreditAttribution: inders commentedComment #11
inders CreditAttribution: inders commentedComment #12
mkhamash CreditAttribution: mkhamash at Vardot commentedThere was a small mistake in the hook_requirements() message in the original patch that I have uploaded, it would show a warning message "The Font Awesome library could not be found" with using the CDN option.
Comment #13
mkhamash CreditAttribution: mkhamash at Vardot commentedComment #15
inders CreditAttribution: inders commentedCommit done . Thank you mkhamash !