0

I have a drupal_add_css in my template.php, following a series of drupal_add_html calls.

The drupal_add_html calls, adding meta tags, work except for the first one (regardless of the order I put them in) which is for a meta generator tag, which the jquery form library I'm using requires. I've also tried getting it in by doing the call for markup rather than a tag...same...it doesn't appear.

The drupal_add_css call does not add the css file (I'm not aggregating), even if I specify the full url. If I add the css file to the list in the .info file, it appears, but I only want the file for a specific page, so I'm doing in the pre-render. When the file is not added, there is no reference to it in the page resources or network list as 404. It does get referenced in the js behaviors object that Drupal inserts.

2
  • It's a cache perform , css and js are in cache loading , you news to clear caches from databases and then reloading your page ( use drush cc all )
    – Fky
    Apr 4, 2017 at 14:55
  • I clear the cache every time I change the template.php file and push it before running. Like I said...other files that I add appear, so I don't think it's caching. With the css file issue, I'm wondering if there is a limit on the number of css files that I'm hitting. On the meta tag, I have no clue.
    – JAyenGreen
    Apr 4, 2017 at 16:12

1 Answer 1

0

It turns out that it's a known problem that core provides a generator metatag without an option of replacing or disabling it. The metatag module will do this, or removing it in a custom module via hooking html_head_alter.

I'm not quite certain why drupal_add_css would not work, but adding it with drupal_add_html_head worked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.