Tag: drupal 7

  • Drupal’s t() variable sanitization

    • !variable: Inserted as is. Use this for text that has already been sanitized.
    • @variable: Escaped to HTML using check_plain(). Use this for anything displayed on a page on the site.
    • %variable: Escaped as a placeholder for user-submitted content using drupal_placeholder(), which shows up as emphasized text.

    http://api.drupal.org/t

  • Drupal Commerce product variations

    Note: this post is about an old version of Drupal: Drupal 7

    A rather complex part of building e-commerce solutions is the aspect of “Product variations”. You should analyse your offer to prevent surprises.

    Drupal Commerce offers this functionality:

    Product attributes are the descriptors we use to define kinds of products. For example, we could describe a tshirt by the color and size. These attributes mean that in the real physical world your store may only carry one red shirt, but you have three sizes or three “variations.” Commerce software must deal with product variations in a flexible way.

    Combine this with Commerce Fancy Attributes for the use of images and more advanced selection visualisations.

  • Handling long-running background tasks in Drupal 7

    If you have a task that must occur regularly, but will take a long amount of time to complete, the cron queue might be a good solution. For instance, if you have a lot of nodes that need to stay synchronized with a remote dataset, you might want to synchronize a large portion of them during a cron run, but would like your other cron tasks to complete in a timely manner.

    Drupal provides an easy interface to adding such long-running background tasks via hook_cron_queue_info() and hook_cron().

  • Drupal 7 Webforms To Salesforce

    When you are using your website to support sales (or conversions otherwise) on a daily basis, Salesforce is one of the better CRM options available.

    With it’s extensive support for custom integrations and connectors (Wufoo, CampaignMonitor,…), it’s relatively easy to build solutions right into your existing online marketing ecosystem.

    We had in our case, using Drupal 7 as the basis for our website, a wide range of modules available that (claim to) provide integration out of the box.

    This is how we got the right solution for our setup:

    Summary:

    Salesforce suite

    Salesforce Suite provides a robust integration with the Salesforce API, at least after patching it. It uses the Sforce.com PHP toolkit to connect to the Enterprise version of the API.

    It then provides mapping between Drupal objects (nodes, users) and Salesforce objects. You could setup a Drupal event content type, map this to Salesforce Campaigns, setup a user as lead or contactperson and create a form that maps registrations to the event to campaignmembers in Salesforce. Read more in this presentation from slide 86 onward


    If you are attracting a significant amount of prospects and they don’t engage on a regular basis, then you don’t want to create user accounts for every person that converts. Drupal Webforms are better suited for that.

    Salesforce webform

    Submitting the values of a Webform to Salesforce is a prblem many tried to solve. The salesforce webform module is a decent solution for Drupal 6, but for Drupal 7 it is in alpha and still lacking. I couldn’t get it to work without patching it.

    The unofficial Drupal module Salesforce Webform integration worked like a charm on our Drupal 7.14 setup. It depends on the module mentioned above: Salesforce Suite, to integrate the API and provides the tools to map Webform 7.x-3.18 fields to your Salesforce objects.

    We decided to extend this module until it fully met our needs by adding the following functionality:

    • enables the module on all webforms, not only webform nodes
    • lets you choose a field to “upsert” on, typically the email adres (the upsert field behaves as if it were a unique key)
    • lets you choose a campaign per webform to subscribe to, and create a Salesforce CampaignMember accordingly when submitting the form (campaigns need to be created in the Salesforce interface)
    • lets you set the status of the CampaignMember per webform

    This updated version of the module is available here.

    I’d love to here your feedback on Twitter!