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 Profiles (Moderator: Dave Greenberg) »
  • Joining groups when creating a new Drupal account (registering on the website)
Pages: [1]

Author Topic: Joining groups when creating a new Drupal account (registering on the website)  (Read 2926 times)

nicrodgers

  • Guest
Joining groups when creating a new Drupal account (registering on the website)
November 07, 2008, 12:37:21 am
I'm setting up a new CiviCRM installation that has two mailing groups configured.

I would like to add the option to join one of those mailing groups on the registration page (http://sitename/user/register) but I'm not sure how to do it. I've created a profile for user registration and added a "Group(s)" field to it, but this shows both groups - I don't know how to specify only one.

I'm probably missing something obvious!

Nic


ansm

  • Guest
Re: Joining groups when creating a new Drupal account (registering on the website)
November 07, 2008, 12:20:12 pm
profile->advanced settings->automatically add to a group.  Adds the user to a group upon signup.  The group can be an access control group or a mailing list, see civicrm->manage groups.

nicrodgers

  • Guest
Re: Joining groups when creating a new Drupal account (registering on the websit
November 10, 2008, 01:55:03 am
Thanks, but that's not entirely what I want to do...

I want to give users the option to tick a checkbox if they want to join a mailing list group. This is not the same thing as automatically adding every registered user to a mailing list group.

The bit I'm unclear about is how to show only one checkbox for a particular mailing list. I've configured lots of mailing list groups but only want to display one on the main registration page. (The others will be displayed elsewhere on the website). 

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Joining groups when creating a new Drupal account (registering on the website)
November 10, 2008, 08:44:37 am

In 2.1 you can use the buildForm hook to modify/add/delete the current form element(s). You might want to investigate using that hook and creating a new group element with the mailing group as the only option for the user register page

alternatively, you can customize the tpl and do the same thing via hardcoding the html and the checkbox. Instructions here:

 http://wiki.civicrm.org/confluence/display/CRMDOC/Customize+Built-in+and+Profile+Screens

the tpl is a bit complex (since all elements are dynamic etc). so will need to have conditionals within the for loop to check on names etc

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

nicrodgers

  • Guest
Re: Joining groups when creating a new Drupal account (registering on the websit
November 10, 2008, 09:02:34 am
thanks Lobo - customizing the template file looks like the way to go, as I'm using CiviCRM 2.0.

Any ideas which template file to edit for the /user/register page?
I followed the instructions on http://wiki.civicrm.org/confluence/display/CRMDOC/Customize+Built-in+and+Profile+Screens which basically says to go to the page, view source and look for .tpl. In my registration page, I can't see any .tpl in the source code.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Joining groups when creating a new Drupal account (registering on the website)
November 10, 2008, 09:28:01 am

CRM/Profile/Form/Dynamic.tpl

That form is used in quite a few different places (all profiles), so you might want to ensure you only customize it for the register case

the comment says that mode=1 is the user/register case :)

lobo

A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Joining groups when creating a new Drupal account (registering on the website)

This forum was archived on 2017-11-26.