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) »
  • Getting contactID in event thankyou template
Pages: [1]

Author Topic: Getting contactID in event thankyou template  (Read 1863 times)

geddeth

  • Guest
Getting contactID in event thankyou template
February 08, 2010, 05:20:30 am
I don't mean to hijack the thread, but it seems you want to achieve the same as myself, which is to show the "CiviCRM ID", or contact ID (civicrm_contact.id DB field) in a Smarty template. I'm just trying to do it from ThankYou.tpl.

I'm fairly new to everything Smarty/CiviCRM, so I may be missing something here, but this is what I'm doing:

Quote
{crmAPI entity="contact" action="get" var="fCRMID" contact_id=$contactId return="currentId"}
ID: {$fCRMID.$contactId.currentId}

However, I don't get any output from that last line. I have a feeling the $contactID variable isn't available from this template, but that's just a long shot on my behalf. What can I do to output this information from the Thank You-template?

I'm using Joomla 1.5 and CiviCRM 3.1.1.

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: Getting contactID in event thankyou template
February 08, 2010, 08:10:48 am

1. u did hijack the thread, so i split the topic :)

2. i looked thru the template and did not see contactID, so most likely we are not exposing it. You might want to add this statement:

{debug}

to the top of the ThankYou.tpl and it will show all the smarty variables that are exposed. you might find it being exposed there

3. if contactID is not exposed, u'll need to expose it via a hook

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Getting contactID in event thankyou template

This forum was archived on 2017-11-26.