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) »
  • Adding CiviMember fields to Profiles
Pages: [1]

Author Topic: Adding CiviMember fields to Profiles  (Read 3032 times)

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Adding CiviMember fields to Profiles
July 07, 2009, 08:54:37 am
Hi thanks for reading.  I would like to add the CiviMember "Membership Type" to a profile.  For instance, in a public display of a list of contacts, I would like to put their membership type next to their name like "Gold Member, Silver Member, Platinum Member" etc....   

However, when I go to add fields to a profile the only one available is "Source" (see attached image).

How to I access more CiviMember fields for Profiles?

 
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Adding CiviMember fields to Profiles
July 08, 2009, 09:55:35 am
Currently "Source" (and any custom fields) are the only supported membership fields in profiles. This limitation is due to the fact that profiles can be used for both viewing (as in your listings case) and create / edit operations. Most of the other membership fields have processing implications associated with setting or modifying their values - so we punted that problem by suppressing them.

One non-hackish approach to solving your problem might be to create a "view only" custom field (these are designed to be populated by some PHP code and are read-only in the user interface). Then write some code in a custom module to copy the membership type label to that field (probably using a post hook).

Or you could try using Views2 for your listings - I "think" the membership fields are exposed to that.
Protect your investment in CiviCRM by  becoming a Member!

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Adding CiviMember fields to Profiles
July 08, 2009, 08:17:31 pm
Looks like I'm going to have to go the Views route.  When I'm done I'll post a follow up on how it did it.  Thanks.

[[update]]
I successfully used Views2 module in Drupal to gather the CiviMember "Membership Type" data and display it alongside the contact name, website and other relevant data.  You can expose a filter in Views (click the rather non-obvious EXPOSE button when creating a filter) and your users can sort your members by membership type, state or whatever you want.

[[update]]
Views2 doesn't handle Contacts with more than one address or more than one phone number.  Such as "work phone" "home mobile" work fax" etc.  This is because the "handler" that is used is a default Views handler and asking CiviCRM for "phone number" actually returns some sort of array, not a single field.  This chokes Views2 and creates duplicate rows and displays, Views and CiviCRM aren't talking like they should be.  To get Views2 to work how I want, it would require a custom handler.  I don't have the time for creating custom handlers, so it's back to the Profiles route.

« Last Edit: July 22, 2009, 11:01:47 am by Stoob »
Try CiviTeacher: the online video tutorial CiviCRM learning library.

rogerco

  • I post occasionally
  • **
  • Posts: 66
  • Karma: 5
Re: Adding CiviMember fields to Profiles
July 29, 2009, 06:50:05 am
Hmmm, I've got the same problem but Views2 is not available for Joomla AFAIK - is there equivalent?

If the fields were flagged as view only in the profile then there wouldn't be a risk, so by exposing them for profiles it would become the administrator's responsibility in creating profiles to make them view only, which might be better than preventing their use.

Current situation makes CiviMember a bit unusable, all I can do is create a smart group of lapsed members and expose that to the membership secretary through a profile form on the front end - but they cant see (eg) expiry date.

Previous post implied there might be a hack - any details how to go about this?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Adding CiviMember fields to Profiles
July 29, 2009, 11:14:04 am
Roger - regarding "hack" - I'm imagining a solution using the postHook to populate a set of custom (read-only) contact fields with the membership data you need (whenever a membership record is inserted or updated). However I'm not sure how much effort this would be - nor whether it's the best approach. Might want to explore this on IRC w/ other developers.
Protect your investment in CiviCRM by  becoming a Member!

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: Adding CiviMember fields to Profiles
July 29, 2009, 01:12:43 pm

You can expose additional data to a profile view page fairly easily. A recipe for doing this for relationship data is here: http://civicrm.org/node/604

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

mariagwyn

  • I post frequently
  • ***
  • Posts: 149
  • Karma: 4
  • CiviCRM version: CiviCRM 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.2.14
  • PHP version: 5.0.91-50-log
Re: Adding CiviMember fields to Profiles
September 15, 2009, 10:54:31 am
I ran into the problem of duplicate rows in setting up a member based directory.  Any additional information on this?

I originally posted the info below here: http://forum.civicrm.org/index.php/topic,9868.0.html
I am using views to create a member directory from CiviCRM data (It integrates better than the profile option, I think).  Currently, I have filters set to "is primary" for phone, address and email field.  I did this because without it, views was listing all address/phone options as multiple rows in a table.  I only want the primary available for viewing.

The problem is, if a record is missing a primary phone number, that record does not appear in the view.  In other words, the filter is not only filtering down to primary data, it is filtering OUT if any single piece of primary data is missing. 

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMember (Moderator: Deepak Srivastava) »
  • Adding CiviMember fields to Profiles

This forum was archived on 2017-11-26.