Drupal Getlocation Multiple Marker Select List Workaround

I had recently been asked to implement a custom Google Map for a client in which there would be multiple markers for different locations, but also a select list of all the locations that the user can click on and the map in turn would focus on. Now in my workplace, we use the Drupal GetLocation module to deal with any Google Maps on the sites. I did some some digging around, messing with views and (a lot) of searching on online and I couldn’t figure out a way, via GetLocations, to achieve this. »

PHP Adjust Colour Brightness

If you just want the function and don’t want to read the rubbish of why I used it then see below my good chum… Use Case I have recently been working on a template built on Drupal, which allows the user to select their own colours using the color module. One feature within the design is to have certain elements that would have a background/border colour that contrasts the background colour select by the user. »

Extra Drupal Body Classes

You can programmatically add extra classes to the body tag via the themes template.php. function themename_preprocess_html(&$variables) { // Add a extra class to the body element $variables['classes_array'][] = 'body__bg-color'; } »

Drupal Getlocations Map Resize

I’ve found recently that Google Maps doesn’t play well within tabbed content. Google’s T&C demands that the map be visible at all times, if their software detects that the map request is hidden then it aborts the load which looks like what is happening with this. To fix this we will need to trigger the resize event when you click on the tab. Easy enough but when using Drupal and the module Getlocations we need make sure the JS including the resize is being called after the Getlocation JS, which is initialising the Google Map. »

Database Import Via Drush

A small command but this has come into it’s own quite recently for me. Saves time having to import databases via MySQL each time. $ drush sql-cli < ~/my-sql-dump-file-name.sql »

Add Conditional Stylesheets Drupal

If you ever need to add stylesheets based on old IE browsers this can be done via the template.php file with this function: function themename_preprocess_html(&$variables) { // If it's IE8 add this Stylesheet drupal_add_css(path_to_theme() . '/css/ie-lte-8.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'lte IE 8', '!IE' => FALSE), 'preprocess' => FALSE)); } »

Drupal Clean CSS Class

A small function which has become a bit of a regular use is Drupal’s Clean CSS Identifier. “Prepares a string for use as a CSS identifier (element, class, or ID name).” drupal_clean_css_identifier($identifier, $filter = array(' ' => '-', '_' => '-', '/' => '-', '[' => '-', ']' => '')); This has become very handy in situations. »

Drupal 7 Views Quicksand Workaround

Recently I’ve been working on a project at work, which needed to the use of Jquery Quicksand coupled with Views to bring in and filter content. Each page when being created would be tagged with a Taxonomy Term to help define what the content is related to. The page needed links above the content which printed out each tag dynamically so the user could filter the content using the Jquery Quicksand animation. »

First Post

Why hello there. As this is my first post let me tell you a couple of things about myself to kick it off. I’ve been a front end developer (well a proper one anyway) for about 3 years now. I’ve done a little bit of most things to be fair, but seem to have settled into my current job working mainly with Drupal. For about 2 years now I’ve been working for an automotive website provider, building websites in Drupal for used car dealers. »