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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Drupal tokens
Pages: 1 [2]

Author Topic: Drupal tokens  (Read 6116 times)

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: Drupal tokens
April 25, 2011, 01:03:58 pm

We are working on a directory of civicrm modules / extensions. You can see this directory here:

http://directory.civicrm.org/

this is still a work in progress

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

drupleg

  • I post occasionally
  • **
  • Posts: 39
  • Karma: 2
    • Drupal.org Profile
  • CiviCRM version: 4.1
  • CMS version: Drupal 7
  • PHP version: 5.3
Re: Drupal tokens
May 02, 2011, 11:26:54 am
This module works great with Drupal 6 + CiviCRM Rules integration, this is exceedingly helpful for me,  THANK YOU for your contribution!

Thanks!
--Tony

druderman

  • I’m new here
  • *
  • Posts: 24
  • Karma: 0
  • CiviCRM version: 4.1+
  • CMS version: Drupal 7
  • MySQL version: 5.0.77 and 5.1
  • PHP version: 5.2.13
Event tokens
May 02, 2011, 11:57:32 am
Great. I'm glad Contact Tokens work for you.
I do wish there were fields for Contact creation and modification dates, but that's not available.

I was easily able to do a first pass and add Event tokens, but unfortunately I have encountered some limitations, so I haven't checked in the code. (It's just a few lines of code anyway.)
Here are a few reasons why Event tokens aren't as easy:
- Only a few of the Event fields are available for 'export'.
- Event Id is not an export field. Not urgent, but probably would be useful.
- Event details like Location are not in the Event array in memory even after an edit, so would have to be loaded. (Meanwhile Contact structure contains Address, Phone, Email, etc.)
- As such, I'd have to explore Events more to figure out how to get at the other parts of an event besides Location.
- Event API is not as fleshed out as Contact API, so I have to include the Event DAO directly.
- Getting Participants for an Event with more than one Participant returns an error status (and a list of Participants).
- Function find() to load an Event by Id (after editing Event Location) was not working for me. May be operator error though.
- I wrote a Rules module in order to expose Event events, so I can do something, but I haven't done more than hook to Event edit.
- And I'm sure there are a few more reasons this is not as simple as Contact.

drupleg

  • I post occasionally
  • **
  • Posts: 39
  • Karma: 2
    • Drupal.org Profile
  • CiviCRM version: 4.1
  • CMS version: Drupal 7
  • PHP version: 5.3
Re: Drupal tokens
May 02, 2011, 12:54:43 pm
I'm just starting to learn Rules and I was thrilled to have found this module.  I'm wondering if there's token/rules exposure for CiviMember also, such as when adding a Membership to a contact?  What I'm trying to do, which has eluded me for almost 4 months now, is to simply create a CMS (Drupal) user when a Membership is added in CiviCRM.  Of course this is easy when created via the front-end Contribute form, as I have the Contribute form configured to automatically integrate with Drupal and create a Drupal user.  However this is a non-profit website who receives membership dues through the mail as well.  So the admin adds the membership to the contact record in the CiviCRM back-end, in that case the Drupal user is NOT created automatically :/...

Maybe there is a simpler solution and I'm just missing it, but I'm trying to use Rules to add the corresponding Drupal user when a Membership is attached to a contact.... am I going about this bass-ackwards?  Also - if I perform this Triggered Rule on contact create then my Rules wouldn't work if the contact already exists and has simply renewed an expired membership for example. What I've just been doing thus far is just CSV importing the user's e-mail address to Drupal via the user import module, Drupal recognizes the CiviCRM record and links the two accounts.  It just seems there should be a simpler solution for this that I'm totally missing?

--Tony

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Drupal tokens
May 02, 2011, 12:56:24 pm
Hmm - druderman - I think I have done many of the same things you have!

In particular

"- I wrote a Rules module in order to expose Event events, so I can do something, but I haven't done more than hook to Event edit." -

are you about on IRC much - we should probably chat
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

druderman

  • I’m new here
  • *
  • Posts: 24
  • Karma: 0
  • CiviCRM version: 4.1+
  • CMS version: Drupal 7
  • MySQL version: 5.0.77 and 5.1
  • PHP version: 5.2.13
Re: Drupal tokens
May 02, 2011, 01:04:41 pm
Eileen, Yes, we can chat. And no, I'm not on IRC enough, but perhaps I can make an effort to do so.

Fortunately, I didn't write much code. I more or less used the civicrm_rules module as my model.
I'm also wondering if the new V3 API would be better to use.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Drupal tokens
May 02, 2011, 01:07:30 pm
Yes, I have been just extending the civicrm_rules - using apiv3 - what timezone are you in? I'd really like to catch up with you in a couple of hours (when the kids are wrangled)
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: 1 [2]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Drupal tokens

This forum was archived on 2017-11-26.