Closed (works as designed)
Project:
Advanced CSS/JS Aggregation
Version:
7.x-2.5
Component:
CSS/JS Compression
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
13 Mar 2014 at 14:38 UTC
Updated:
13 Mar 2014 at 18:52 UTC
Jump to comment: Most recent
Comments
Comment #1
mikeytown2 commentedLooks like the Porto theme is adding CSS to Drupal incorrectly. Unfortunately that is a paid theme so I can't offer a patch to fix the theme's code as I don't have the theme's code at hand. There are multiple ways to add CSS in Drupal and it appears that the porto theme is using #6 or #7 on the list and my guess is they are using #6 drupal_add_html_head()
http://wearepropeople.com/blog/7-ways-to-add-custom-js-and-css-to-a-page...
The reason I know this is the case is because the html is structured like so with the title in the middle of the CSS.
If the CSS was added in correctly it wouldn't have a title tag in the middle.
In terms of options, the best one is to have the CSS be added correctly by the theme.
I'll be working on an alternative that will look through the html_head code for CSS and/or JS that was added in incorrectly https://api.drupal.org/api/drupal/modules!system!system.api.php/function...
Comment #2
cwschimpff commentedMikey,
Thanks for your fantastic sleuthing!
Assuming I go into template.php and remove all drupal_add_html_head() calls and replace them with drupal_add_css() calls, do you think that would solve the issue and allow AdvAgg to compress/gzip them properly?
Comment #3
mikeytown2 commentedI think that would do the trick. When adding the CSS I would set a couple of options so that the theme CSS shows up first (like it currently does).
Comment #4
cwschimpff commentedEver been somebody's hero for the day? If not, today's your lucky day. That worked like a charm.
Thank you so much for taking time out of your day to help me with this! Should I mark the issue 'closed'?
Comment #5
mikeytown2 commentedYou can go ahead and set the status to "Closed (works as designed)" :)
Comment #6
cwschimpff commented