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) »
  • Drupal Panels and civi contact field integration
Pages: [1]

Author Topic: Drupal Panels and civi contact field integration  (Read 892 times)

kimberley-p

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
  • CiviCRM version: 4.4.6
  • CMS version: Drupal
  • MySQL version: 5.5.37-cll
  • PHP version: 5.3.28
Drupal Panels and civi contact field integration
October 23, 2014, 08:20:21 am
Hey,

I am trying to build a user profile in panels with a mix of drupal and CiviCRM fields. I can't find an efficient way to access the civi fields from panels.

Is there a way to get the civi contact record as a relationship on the panel? It isn't an option on there but wondered if there is a module or way to do this to give the panel access to the contact record fields (or at least the ones that are selected to be used on drupal edit account). It seems like I must be missing something for this not to be possible.

I have built a drupal 'user' view with a contextual filter of the user id (from url) and a relationship to the civi contact in order to show what I need but it seems heavy to have to do this for every field I want to show in a panel.

Is there a way to do this with tokens (I couldn't find any modules that specifically added civi contact tokens to drupal) or a module that extends the panel relationships or a custom way?

Thanks a lot,
Kim

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Drupal Panels and civi contact field integration
October 23, 2014, 08:32:16 am
Hi Kim,

I don't have any good answers for you since I'm not really a Drupal dev - but since no one else has responded yet, I can give a few thoughts on where to look.

I know that when bangpound (https://www.drupal.org/u/bangpound) worked for my organization, he pulled Civi data into panels.  I'm pretty sure that work got handed off to Eileen when she started work on civicrm_entity (https://www.drupal.org/project/civicrm_entity).

I haven't worked with civicrm_entity, so I don't know if it adds contact tokens.  If not, I think the folks I mentioned might have a clue on where to go next.

Actually, one more thought - the Civi API is pretty great.  I bet it wouldn't be hard to code up what you want.  Check out the API explorer at yoursite/civicrm/api/explorer and also http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API.

Jon

Jon
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

kimberley-p

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
  • CiviCRM version: 4.4.6
  • CMS version: Drupal
  • MySQL version: 5.5.37-cll
  • PHP version: 5.3.28
Re: Drupal Panels and civi contact field integration
October 23, 2014, 08:35:06 am
Thanks a lot for your reply Jon.  I'll follow up on those leads :) Just looking into civiCRM Entity now. Would be great if that did the job.

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Drupal Panels and civi contact field integration
October 23, 2014, 08:45:12 am
Great - please post back here with what you find!  I'd love to know.
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

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: Drupal Panels and civi contact field integration
October 23, 2014, 12:06:45 pm
want to flesh out the scenario? getting the civi fields 'displaying' on the profile page as a Views block should be straightforward if that suffices - with a link to the civi profile to update it
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

kimberley-p

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
  • CiviCRM version: 4.4.6
  • CMS version: Drupal
  • MySQL version: 5.5.37-cll
  • PHP version: 5.3.28
Re: Drupal Panels and civi contact field integration
October 24, 2014, 07:20:15 am
Thanks all, having had a look at CiviCRM Entity I don't think it does what I need. It makes further entities available to drupal (like memberships/tags/relationships) but doesn't change the way those entities can be handled in things like panels. This module will be super helpful for me down the line as I will need access to those in views, however for this particular issue it doesn't solve it.

As I say, using views I can achieve what I need, exposing that data in views is straightforward enough so I will do that for now.

I may put in a request with the Drupal panels module though to look into better civiCRM integration (allowing a relationship to the civiCRM contact record to expose that data) and (to cover all my bases) also to the token community to see if anyone wants to have a go at a CiviCRM Drupal Token module to just provide those tokens to Drupal in the way other user drupal info is available. If I were capable I would do that myself but unfortunately my backend civi knowledge is very very limited.

Thanks for everyone's help. For other users with this issue, the details of the basic view I am using is below.


---

(This will work if using the view on a user's profile page (as it gets the user ID from the URL)

Create a view that shows "users"
Add a contextual filter of User: Uid
 - provide default value "User ID from URL"
Add a relationship of "CiviCRM Contacts: Drupal ID"

That expose the user being viewed's contact record fields so then you can add whatever field you require.

Civicrm entity gives you more to play with once this relationship is set up but for pulling basic contact fields across, you're all set.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Drupal Panels and civi contact field integration

This forum was archived on 2017-11-26.