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 CiviMember (Moderator: Deepak Srivastava) »
  • Membership form customization
Pages: [1]

Author Topic: Membership form customization  (Read 2693 times)

billoum

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.1.1
  • CMS version: Drupal 6.25
  • MySQL version: 5.0.95
  • PHP version: 5.2
Membership form customization
April 09, 2012, 09:29:57 am
Hi all,

I've created a custom field linked to the contributions, it appears in the new contribution form and the value is inserted in the database after it's submitted.

The problem comes when I try to add a new membership, the field is not present in the contribution part of this form.


So I tried to add it on the form trough the build_Form hook :

Quote
if ($formName == 'CRM_Member_Form_Membership') {
$form->addElement('text', 'custom_16', ts('Communication'));
}

and then, in CRM/Member/Form/Membership.tpl :

Quote
{$form.custom_16.label}  {$form.custom_16.html}

I can see the element but no value is inserted in the db when the form's submitted...

Can anyone help?

Thanks,
Bill


ps: When I try to use the "Insert Code" tag on this forum I get this message:
"Sorry, you are not allowed to post external links."

satchmo

  • I’m new here
  • *
  • Posts: 17
  • Karma: 0
    • Flying Horse Tech
  • CiviCRM version: 41
  • CMS version: Drupal 7.12
  • MySQL version: 5.2
  • PHP version: 5.2
Re: Membership form customization
April 09, 2012, 11:48:26 am
Can't you use CiviCRM Profiles to achieve this? You don't even need to use hooks in this case.
“After one look at this planet any visitor from outer space would say ''I want to see the manager.''” - William S. Burroughs

billoum

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.1.1
  • CMS version: Drupal 6.25
  • MySQL version: 5.0.95
  • PHP version: 5.2
Re: Membership form customization
April 10, 2012, 06:14:37 am
For me it looked like it was easier to make a custom template of this form, as I was just missing this custom field on it.

But I'm totally new in civicrm so it may be done with profile but I didn't see a way to go in that direction...


Thanks for your reply


NASACT

  • I post frequently
  • ***
  • Posts: 289
  • Karma: 9
    • National Association of State Auditors, Comptrollers and Treasurers
  • CiviCRM version: 4.2.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.58 (ubuntu)
  • PHP version: 5.3.5
Re: Membership form customization
April 11, 2012, 11:01:11 am
You should be able to do this with a profile (just a collection of like data, custom or built-in) If you need to add this to the reserved forms there is a way to do that. I do this for a custom dataset that is of type org but needs to be in the membership form, which is currently the only way to add unlike data together since a membership page wants to use only membership/contribution data sets.  Hooks should only be used when the data cannot be gotten at by one of civicrm methods.
-AJ
My GChat - azon21@gmail.com -  This is where you can find me most days!

billoum

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.1.1
  • CMS version: Drupal 6.25
  • MySQL version: 5.0.95
  • PHP version: 5.2
Re: Membership form customization
April 13, 2012, 04:21:24 am
Quote from: NASACT on April 11, 2012, 11:01:11 am
I do this for a custom dataset that is of type org but needs to be in the membership form, which is currently the only way to add unlike data together since a membership page wants to use only membership/contribution data sets.

I'm not sure I understand; I'm actually talking about a contribution field in a membership form… But I followed your advice and started to work only with profiles.


I created an individual profile so the current user can modify its informations, I used this link "civicrm/profile/edit?reset=1&gid=N", working fine.

In the redirect url of this profile, I've put "civicrm/profile/create?reset=1&gid=N" to display a profile where you should add a new membership to the individual. But there I receive a warning (in french, I tried to translate it) ".. not possible for profiles including more than one type of record"


I say it again I'm totally new in civicrm so I apologize if I ask stupid questions, if you know a simple example or a tutorial about this I'll be happy with it.


Thanks

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: Membership form customization
April 15, 2012, 11:42:15 am
Hi - what type of fields are you including in the Profile?

Are you including the Profile in the Contribution Page?
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

billoum

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.1.1
  • CMS version: Drupal 6.25
  • MySQL version: 5.0.95
  • PHP version: 5.2
Re: Membership form customization
April 16, 2012, 03:24:25 am
Hi,

I created 2 profiles and they're used as stand-alone forms.

In the first one I've put the user's informations (like first & last_name, email, address and some custom fields linked to the individual). After it's submitted, you're redirected to another profile where you should be able to add a new membership to that user (for the moment I've only put the membership type on that profile).

In short I want to give the user the oppotunity to modify it's personnal informations before he creates a new membership.
 
Thanks

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: Membership form customization
April 16, 2012, 11:40:35 am
It sounds like you are paddling upstream and i don't understand why you are using a Contribution Page which is the standard way of doing Membership forms. Pls explain so we can hopefully provide some insight that might help.
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

billoum

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.1.1
  • CMS version: Drupal 6.25
  • MySQL version: 5.0.95
  • PHP version: 5.2
Re: Membership form customization
April 17, 2012, 03:06:47 am
I just want to create a form where the user can modify its personnal informations, then add a membership and the contribution linked to that membership.

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: Membership form customization
April 17, 2012, 12:47:46 pm
I am still not clear.
Are you trying to make a Membership/Contribution form as per http://drupal.demo.civicrm.org/civicrm/contribute/transact?reset=1&id=2
If so you can use that as the url link from the 'individual profile' but am unsure why you don't include the profile on the Membership Form.
If this is all new to you have you looked at the manual? http://en.flossmanuals.net/civicrm/ch035_what-is-civimember
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

NASACT

  • I post frequently
  • ***
  • Posts: 289
  • Karma: 9
    • National Association of State Auditors, Comptrollers and Treasurers
  • CiviCRM version: 4.2.2
  • CMS version: Drupal 7
  • MySQL version: 5.1.58 (ubuntu)
  • PHP version: 5.3.5
Re: Membership form customization
April 18, 2012, 06:14:25 am
Hi,

I hope I can clarify the issue at hand I believe is what is of concern here.  I believe the issue is the use of profiles.  Membership can only use a profile that has been designated for use with membership, if it is designated to be used with an individual it cannot be directly used in a membership contribution page.  That was a point of confusion for me as well. The only way to add individual profile custom data or data sets is the add them to the "reserved" profiles, that is the only way I know to do it.  I do this for a custom dataset that is used for an organization type to collect information that is only pertinent during membership sign-up or renewal but since the custom data set was really characteristics of the organization type then it was placed there instead of in custom data set of membership type.

Hope that helps to clarify where I believe the point of confusion is and seems to come up a lot.  Without reading the floss manual a couple of times I think this is one area that is often overlooked in understanding from those just starting out.
-AJ
My GChat - azon21@gmail.com -  This is where you can find me most days!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMember (Moderator: Deepak Srivastava) »
  • Membership form customization

This forum was archived on 2017-11-26.