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 »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Help displaying membership info with crmAPI
Pages: [1]

Author Topic: Help displaying membership info with crmAPI  (Read 632 times)

marthirial

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
Help displaying membership info with crmAPI
November 16, 2010, 10:34:45 am
This is what I have added to the summary tab template:

{crmAPI entity="membership_contact" action="get" var="mymm" contact_id=$contactId }
{foreach from=$mymm.result item=array}
<p>Join Date{ $membership_contact.join_date } with End Date { $membership_contact.end_date } </p>
{/foreach}

This is not bringing anything though and I cannot find any help on what I am doing wrong.

« Last Edit: November 16, 2010, 10:36:05 am by xavier »

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Help displaying membership info with crmAPI
November 16, 2010, 10:41:45 am
item=membership_contact in your foreach

If you still don't get anything, start debugging calling directly the ajax method
http://example.org/civicrm/ajax/rest?fnName=civicrm/membership_contact/get&json=1&contact_id=XXX

See what it returns, what format... (easier than having to modify a template)

And if you want to know more about it: http://en.flossmanuals.net/CiviCRM/DevelopAPI

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

marthirial

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
Re: Help displaying membership info with crmAPI
November 16, 2010, 11:06:22 am
Xavier,

Thanks for the info, tried it and it didn't bring anything again.

The ajax method url is for Drupal, I am using Joomla, so not sure how to format the URL.

Thanks

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Help displaying membership info with crmAPI

This forum was archived on 2017-11-26.