Contact block maintenance release + new features

We're happy to announce that the new version of our Contact block is now available. This was initially a maintanance release, but it's been a while since we gave the Contact block some love, so we decided to add some of the features we've had planned.

Google Maps Overhauled

You will notice there is a lot of new functionality relating to the Google Maps. In previous versions, we used a Google Maps jQuery plugin, weighing in at a whopping 34kb. Rather than relying on a plugin, the new version has it’s own Google Maps javascript written from scratch!

Not only does this give us a lot more flexibility, but it also means a big reduction in the amount of code needed to render the block.

The previous plugin weighed in at 37kb with +/- 1250 lines of code. The important thing to note here is that all of that is loaded, regardless of whether you are using the more advanced features.

The new version weighs in 3kb and a maximum of 70 lines of code; and that’s only if you are using ALL of the map features! Pretty cool, eh?

Apart from the map updates, the block has received an overhaul on all the php and admin javascript code. Not only is there less code, but it’s also more efficient.

Here is a full list of the changes:

Contact block v1.2.0

  • New option to add row spacing.
  • Added margin options in the Design mode for all the relevant block elements.
  • Contact number now displays as a link on mobile devices.
  • New option to set the map to satellite, road, etc.
  • New option to display traffic information on the map.
  • New option to display bike lanes information.
  • New option to have the map pin info panel open by default.
  • New option to display the map controls.
  • New option to set whether the scroll wheel should be enabled.
  • New option to customize the map image marker.
  • Added support for Google Maps Directions (beta).
  • Added support for Google Maps KML (beta).
  • Changed the “Form Width” default value from 40% to 38%.
  • Changed the “Columns Spacing” unit from px to % & changed default value to 1%.
  • Changed the “Enable Custom Address” option type to a select field type.
  • Changed the “Enable Custom Form” option type to a select field type.
  • Changed the “Custom Form” option type to a textarea field type.
  • Changed the “Enable Custom Address” label to “Address Output”.
  • Changed the “Enable Custom Form” label to “Form Output”.
  • Replaced the Google Maps js with our own, giving us more flexibility & code reduction.
  • Improved the equal heights javascript.
  • Improved the php throughout the block.
  • Completely rewrote the admin block options javascript.
  • Fixed the “delails” typo in the email form.
  • Fixed the issue where the map would flash on Cape Town before loading properly.
  • Fixed the issue where the captcha would not show up in some cases.

When will it be available?

We’ve just sent the block to Clay to review, so if all goes well, it should be available in Extend later today.

Upgrade notes:

Please remember to always do a full backup before upgrade and if at all possible, test the update locally before updating your live site.

As always, we do our best to ensure that there are no issues when upgrading, but please make a note of the upgrade note below, as it’s how we let you know of any of the options need to be manually updated.

Since the “Columns Spacing” value was changed from pixels to percentage, you might need to adjust the spacing (if you changed it before).