Custom theming: Add html5 placeholder attribute to a webform component in theme
You can add an html5 placeholder attribute in your theme using a preprocess hook. Here's an example for an email component:
<?php
function THEMENAME_preprocess_webform_email(&$variables) {
$variables['element']['#attributes']['placeholder'] = t('Email Address');
}
?>Current Node Email field token
setup token
use the token custom module to create a new custom token with name "nodeemail" of TYPE: custom
and use php filter with following code
<?php
if(arg(0)!="node")
return "not viewing a node";
$node = node_load(arg(1));
return $node->field_email['und'][0]['email'];
?>now wherever you have tokens available you can use [custom:nodeemail]
NOTE1: assuming that email field has machine name field_email and is not translatable ('und') otherwise change accordingly
NOTE2: to get more node fields use echo print_r($node); in the custom token or look at http://drupal.org/node/49768
Who needs this custom token ?
webform 4.x adds support for tokens but if webform is attached to node using "webform block" the tokens are not populating the webform fields as reported in #1544044: Attach webform to node, email to field from node and #1617086: Webform > E-mails: Add "Content values" (ie: node field) support so custom token is needed
This custom token might not be needed after this issue is resolved #919760: Add a [current-page:object:?] dynamic token
Secure a Webform with SSL in mixed-mode while maintaining a positive user experience
Securing a webform is easy using a module such as Session 443 or Secure Pages but what about scenarios where a user abandons the form and browses the site using the primary or secondary menu. If you don't have the menu interaction planned out correctly they could end up receiving insecure content warnings and may even abandon the site altogether. Another scenario is when a user submits the form, do they continue to a confirmation page in SSL mode? This too can create problems with the user receiving insecure content warnings. Drupal's API makes it possible for UX professionals to create the best user experience. So below are a couple snippets for Drupal 6 that will solve these specific use cases with no additional modules. These snippets assume you have secured your webform with Session 443 or Secure Pages modules but theirs no dependencies on either.
First lets look at the first function that will alter the primary menu links. This function is called "THEME_NAME_menu_item_link($link)" and needs to be placed in "template.php" in your theme folder. Replace THEME_NAME with the name of your theme. This function defines the navigation menus, and route page requests to code based on URLs.
<?php
function THEME_NAME_menu_item_link($link) {
global $base_path;
Webform Layout (Spanish Vídeo)
Módulo Webform Layout , añade la funcionalidad de alinear los campos de webform horizontalmente y guarda compatibilidad con el resto de funciones.
Using Webform CiviCRM Integration 3
Introduction
These instructions assume you already know how to use CiviCRM and the Drupal Webform module. Read those manuals first.
This module leverages Webform, Drupal and CiviCRM to create a smart form builder and processor that can work with a wide variety of CRM data. CiviCRM Webforms can create and update information about contacts, relationships, cases, activities, event participants, group subscriptions, tags, and custom data.
Getting Started
- Download and enable this module, plus its dependencies: CiviCRM, Webform, and Libraries.
- Download jQuery TokenInput and extract as the folder "sites/all/libraries/tokeninput" (or another location permitted by the libraries module).
- Create a new webform (or go to edit an existing one).
- Click on the CiviCRM tab.
- Enable the fields you like, and optionally choose introduction text and other settings.
- Customize the webform settings for your new fields however you wish.
Upgrading to Version 3
Read moreUpgrading from Webform 3.x to 4.x
This page documents changes between the Webform 3.x version and the Webform 4.x version, including any information you need to know when upgrading from one version to the next.
The most important thing to keep in mind when upgrading from Webform 3.x to 4.x is that you cannot downgrade after update.php has been run, unless you restore a database backup created before the update.php run. Webform 4.x makes several database changes and downgrading after you have upgraded is not possible. Be sure to test your upgrade on a development server or localhost copy before upgrading your production server.
Changes between Webform 3.x and 4.x:
ALPHA1
ALPHA2
Detailed Change Instructions
Token System Replaced with D7-style Tokens
(issue) Webform previously used it's own custom token system to provide common tokens such as %title, %username, or %value[key]. In Webform 4.x, we use the token system provided by Drupal 7 core, which uses a format such as [node:title], [current-user:name], or [submission:values:key].
Read more