drupal

Sticky Footer with Omega Theme for Drupal

As I keeping going back and searching the d.o. issue queue for those few lines constantly I'll put them up here for future reference:

HTML, BODY {
  height: 100%;
}

#page {
  min-height: 100%;
  position: relative;
}

#section-content {
  padding-bottom: XX;
}

#section-footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: XX;
}

Pure CSS, no template changes needed, works with Omega right out of the box.

Origin:

Drupal: Packaging Content Types with Features while keeping Field Groups intact

Disclaimer: I have no idea why this works, but at least it does.

It seems like a good idea to package complex Drupal content types into reusable packages using the great features module. One fundamental part of content types are field groups. While field groups seem to be detected nicely as dependencies when creating a feature they just seem to never appear when dropping the feature into another site.

After digging around the forums I found out that adding the following code inside the function myfeature_ctools_plugin_api() (located inside myfeature.features.inc) did the trick:

  if ($module == 'field_group' && $api == 'field_group') {
    return array('version' => 1);
  }

So the implementation of hook_ctools_plugin_api currently looks like this (due to using display suite and responsive images and styles):

Drush Make on Domainfactory Hosting

Shortly before going completly mad I got this stuff working. By default Domainfactory runs php4.4.9-cgi when simply calling php on the command line. As Drush needs PHP5 I used to help myself by aliasing the drush command to call something like php5-53STABLE-CLI drush.php through my .bashrc file.

Turned out that wile this works more or less well for Drush itself it doesn't cut it for drush make. Long story short, there's a DRUSH_PHP variable. Once that gets fed with the path to a somewhat current version of PHP5 everything works well. Also, I don't have to call drush.php anymore. So here's my .bashrc:

alias drush="~/drush/drush"
export DRUSH_PHP=/usr/local/bin/php5-53STABLE-CLI

Happy Making!

Update:
Somehow this stopped working recently, the following Alias does work though:

Keep EXIF data in Drupal by using ImageMagick instead of GD

In case you're using Drupal for some kind of photo gallery be advised that all your images' EXIF data get removed as soon as you set maximum image dimensions for your image field (and upload images bigger than those specified dimensions).

The problem is that GD simply doesn't support EXIF. So the solution sounds simple: Tell ImageAPI to use ImageMagick instead of GD.

To do so you first need to install the ImageMagick module and make sure your server has ImageMagick installed.

After enabling ImageMagick module be sure to set the correct path to the convert binary. You can find it by entering whereis convert inside a terminal on your server (SSH access is required). Usually it should be something like /usr/bin/convert.

If you're lucky that's all you have to do. I wasn't lucky.

Drupal: Apply text format filters live on Paste

Here's a brief recap of what I did to make it work to apply filters right upon pasting rich text into Ckeditor. This will only work in combination with Ckeditor (I'm using Ckeditor module, but it should also work wia WYSIWYG module)

What Pasteformat basically does is filtering text that gets pasted into Ckeditor live upon pasting.

This is a great improvement in terms of usability for content editors, as it reduces al lot of confusion. Normally when pasting richt text you see all the original formatting right inside Ckeditor and it doens't disappear until you view your saved content (because Drupal stores everything in the database and the filter system fires upon viewing). Though there are good reasons for this behaviour it's really everything but intuitive to see something different inside you WYSIWYG(!!) editor than what will appear on you published pages.

Pages