CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Using Groups in CiviCRM Webform
Pages: [1]

Author Topic: Using Groups in CiviCRM Webform  (Read 1863 times)

britebyte

  • I post occasionally
  • **
  • Posts: 70
  • Karma: 2
  • CiviCRM version: Several 3.4+, 4.1+
  • CMS version: Drupal 6, Drupal7
  • MySQL version: Several 5.1+
  • PHP version: Several 5.2+
Using Groups in CiviCRM Webform
April 13, 2012, 11:53:09 am
I have started using the fantastic Webform CiviCRM Integration Module. However, I am having trouble trying to add some selects or checkboxes on a webform in order to have users add themselves to groups. I have made some groups which are visible to Public Pages. They are not Access Control or Mailing list groups.

So next when I set "Enable Tags and Groups Fields" to Yes on the CiviCRM tab of the Webform two lists show up one with my groups and one with tags plus the help message below:
Quote
You may choose options here and/or add this element to the webform. If you do both, options selected here will not appear on the form.

A. I tried multi-selecting some of the options, saving the form and no groups selector appeared on the webform so I assumed that the user would be added to all the groups automatically in this case - not what I want.
B. If I wanted to "add this element to the webform" how do I  do it? The other CiviCRM fields I checked off like "email" automatically inserted themselves in the list of webform components but the groups field did not.

I am wondering if I need to know the field ID of the groups field and manually add a component for it: If so where do I find the field id?

Thanks everyone....

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Using Groups in CiviCRM Webform
April 15, 2012, 11:44:25 am
hi - did you have a look at the webform component that is created once you tick the 'groups' in the civicrm tab - from memory you need to do some of the config in the webform  component - but my memory has been trashed by jetlag so i may be sending you on wild goose hunt
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Using Groups in CiviCRM Webform
April 15, 2012, 01:33:12 pm
In the multi-select, choose the first option: "User Select" - don't choose other options unless you want these groups to always be added.
"User select" creates a webform element (checkboxes) which you can configure to allow selection of the groups you want.
Try asking your question on the new CiviCRM help site.

britebyte

  • I post occasionally
  • **
  • Posts: 70
  • Karma: 2
  • CiviCRM version: Several 3.4+, 4.1+
  • CMS version: Drupal 6, Drupal7
  • MySQL version: Several 5.1+
  • PHP version: Several 5.2+
Re: Using Groups in CiviCRM Webform
April 16, 2012, 06:37:09 am
Quote from: colemanw on April 15, 2012, 01:33:12 pm
In the multi-select, choose the first option: "User Select" - don't choose other options unless you want these groups to always be added.
"User select" creates a webform element (checkboxes) which you can configure to allow selection of the groups you want.

Thanks. That was it. I really should have thought of that. I think I missed it because I didn't want all the listed options available to the user in this form.  I am very new to webforms as well and I back on Friday mid-day I didn't know you could limit the options after adding the component to the form.

britebyte

  • I post occasionally
  • **
  • Posts: 70
  • Karma: 2
  • CiviCRM version: Several 3.4+, 4.1+
  • CMS version: Drupal 6, Drupal7
  • MySQL version: Several 5.1+
  • PHP version: Several 5.2+
Re: Using Groups in CiviCRM Webform
April 17, 2012, 12:28:54 pm
One followup question: Is it possible to have two groups of groups?
For example some of the components ask: "How many email fields to add?" but I notice the groups option does not ask "How many group selects to add". There is only the option to enable/disable groups. If possible I would like to have two groups of check boxes which add contacts to two totally different group categories.

I think that looking at this code from webform_civicrm_forms.inc it is not possible. It looks like only one groups field is processed.
If not possible using the module how might I try to accomplish this? I suppose Javascript?

Code: [Select]
      // Process groups & tags
      $field = 'civicrm_' . $c . '_contact_1_other_';
      foreach (array('group', 'tag') as $type) {
        if (!empty($contact['other'][1][$type]) || isset($enabled[$field . $type])) {
          $fid = webform_civicrm_aval($enabled, $field . $type, 0);
          $add = webform_civicrm_aval($contact, "other:1:$type", array());
          webform_civicrm_add_remove($type, 'contact', $node, $cid, $add, $fid, !empty($updating['cid'][$c]));
        }
      }

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Using Groups in CiviCRM Webform
April 17, 2012, 01:43:28 pm
You're right, it doesn't support multiple group widgets for a single contact.
But what you're talking about is not a change to the data structure, you just want a different way of visually organizing it. Arranging the checkboxes into two columns would do it, I imagine.
If you'd be interested in sponsoring it, I can add this feature to the webform_layout module - probably just a 1-2 hour job.
Try asking your question on the new CiviCRM help site.

britebyte

  • I post occasionally
  • **
  • Posts: 70
  • Karma: 2
  • CiviCRM version: Several 3.4+, 4.1+
  • CMS version: Drupal 6, Drupal7
  • MySQL version: Several 5.1+
  • PHP version: Several 5.2+
Re: Using Groups in CiviCRM Webform
April 19, 2012, 10:06:54 am
Hi Coleman,

Thanks for your work on the module and thanks for your assistance again. I am not sure if I understand your description of the changes about two columns I just hope it wouldn't limit the layout options available on the webform component. Our requirements for the multiple groups of groups/tags feature would be:  Since we are using multiple languages we want to translate the titles of each group of groups separately hopefully using the translated webform node.

I am not sure if we can sponsor this at the current time but if you can PM me an expected cost range I will bring it up at the next meeting.


Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Using Groups in CiviCRM Webform
April 19, 2012, 01:37:28 pm
I don't see you on IRC. What's your nick?
I'm not very familiar with translations, but don't understand why you would want stuff translated into multiple languages on the same page? Wouldn't you want everything translated into the same language (that of the current user)? And if you did want multiple languages at once, why not just do it manually by editing the group labels in the webform component?
Try asking your question on the new CiviCRM help site.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Using Groups in CiviCRM Webform

This forum was archived on 2017-11-26.