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.
Ok. This is going to be a little crazy, but hear me out.
I'd like it if there was a drupal_alter() on the data prior to saving the CSS in advagg_save_data(). This would allow for e.g. something like Color.module that could be used with SASS so that the site's colors could be customized from the website and then bundled up with the compiled SASS and pushed through AdvAgg. Sounds crazy, but it'd open up some interesting possibilities for sites that want website-level color control.
Comment | File | Size | Author |
---|---|---|---|
#1 | advagg-n2217381-1.patch | 1.26 KB | DamienMcKenna |
Comments
Comment #1
DamienMcKennaHere's the patch with the drupal_alter() line and documentation in advagg.api.php.
Comment #2
mikeytown2 CreditAttribution: mikeytown2 commentedWhat about hook_advagg_save_aggregate_alter()? I use it to gzip files as an example.
Thinking I should alter the weight of advag_advagg_save_aggregate_alter so it runs last now that I see other use cases for this. This same hook is used here for S3 #2143913-9: Configure stream wrapper for storing aggregates
Comment #3
mikeytown2 CreditAttribution: mikeytown2 commentedThe other alt for this use case is higher up hook_advagg_get_css_aggregate_contents_alter(). Given your example use case this is the hook I would use.
Comment #4
DamienMcKennaOh, hey, awesome. Yeah, these will work, thanks!
Comment #5
mikeytown2 CreditAttribution: mikeytown2 commentedYep :)
If you want to go even higher, before the CSS is aggregated together hook_advagg_get_css_file_contents_alter() would be the ticket