0

FYI, I don't know Drupal at all. What I've done is stick a WordPress install at /blog/ and pull in the /sites/default/css/css_randomstring.css and static html from the Drupal page - and along with the WordPress loop in the index.php file of Wordpress - somewhat integrate WordPress into Drupal. (I don't want to use the Drupal WP module).

The problem is that the Drupal CSS link changes when there are small edits from time to time on the Drupal end. (The php/html of the Drupal site isn't slated to change.)

Question: are these randomstring CSS files a cache or the active CSS file? How can I dynamically pull in the sites/default/css/css_(randomstring).css file when the string changes? Or is there a different CSS file I should be linking to?

2

To answer your direct question, drupal's CSS and JS aggregation contains a random MD5 hash to guarantee uniqueness, and also to guarantee that there is no programmatic way to work this out.

In order to include CSS and JS from an aggregated site into another CMS there are a couple of options:

  • Use un-aggregated CSS and JS and link to the files direct (bad)
  • Compress the files yourself and host them in a known location - e.g. /css/main-compressed.css
  • Or another option is what we have used in the past where you basically make a really simple page.tpl.php which includes basically no content, and is for all intensive purposes a blank wrapper for your site. You have your other CMS drag this template down after every deployment, and then used it for it's page wrapper. This way you do not need to worry about the CSS and JS changing as you always have the most up to date versions in the <head> section.

Hope this helps

  • That makes sense to make a page template and then call that in WP. I think I need to do that in order to pull the menu in. But what are the issues with linking to un-aggregated CSS and JS files directly? Bandwidth and loading too many smaller files? – markratledge Aug 19 '11 at 2:26
  • You pretty much hit the nail on the head, if you reference each individual stylesheet you will potentially have > 50, and if you ever add one in drupal, it won't be propagated to the other CMS – wiifm Aug 21 '11 at 6:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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