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 CiviEvent (Moderator: Yashodha Chaku) »
  • Data displayed on thank you page via conditional referencing event_type_id
Pages: [1]

Author Topic: Data displayed on thank you page via conditional referencing event_type_id  (Read 1506 times)

cat1265

  • Guest
Data displayed on thank you page via conditional referencing event_type_id
February 24, 2009, 01:55:21 pm
Hello,

I need to display a button on the thank you page when the registered event has a certain type, let's say type = 3. I am trying to get the value of the $_SESSION variable [event_type_id], which is nested under the [CiviCRM] [CRM_Event_Controller_Registration_'some number'] array.

The following:

$eventtype = $_SESSION['CiviCRM']['[CRM_Event_Controller_Registration_'some number'']['values']['event']['event_type_id'];

does not work - as I need to account for all possible instances of 'some_number'. How do I do that?

Thank you for your help.

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: Data displayed on thank you page via conditional referencing event_type_id
February 24, 2009, 08:52:13 pm

where r u trying to do this? if in a civicrm context: $form->get( 'event_type_id') will do the needful

best to ping us on IRC if u have more questions or need help: http://embed.mibbit.com/?server=irc.freenode.net&channel=%23civicrm&forcePrompt=true

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

cat1265

  • Guest
Re: Data displayed on thank you page via conditional referencing event_type_id
February 25, 2009, 05:55:58 am
I posted the following on the IRC group page

Quote
Thank you for responding to my question on the forum http://forum.civicrm.org/index.php/topic,6771.0.html . I am trying to do this in a custom ThankYou.tpl, but am testing in the EventInfo.tpl (so I do not have to go all the way through registration to test the logic). I am fairly new to smarty, so am unsure if I can use your suggested $form->get( 'event_type_id') in the template to pull out the event type id. Should I just wrap it in {php} tags with the rest of my statement?

cat1265

  • Guest
Re: Data displayed on thank you page via conditional referencing event_type_id
February 25, 2009, 07:00:28 am
I must not be using the chat room correctly, I can see others chating - but people are not responding to me. It seems pretty straightforward, so I am unsure what I am doing wrong. In any case, would someone mind answering this:

I am fairly new to smarty, so am unsure if I can use your suggested $form->get( 'event_type_id') in the template to pull out the event type id. Should I just wrap it in {php} tags with the rest of my statement? From within the .tpl I need to

1. Get the event_type_id
2. Check if it is type 3
3. If yes, display text and link on the page
4. If no, do nothing

Any help would be greatly appreciated.

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: Data displayed on thank you page via conditional referencing event_type_id
February 25, 2009, 07:49:31 am

1. you need to hang around the chat room for some time. if u leave immediately folks dont get a chance to respond. and we are not checking it all the time (its a bit asynchronous)

2. we expose event_type_id to smarty. so in your ThankYou.tpl you can use the syntax:

{if $event.event_type_id == 3}
{else}
{/if}

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

cat1265

  • Guest
Re: Data displayed on thank you page via conditional referencing event_type_id
February 25, 2009, 08:50:34 am
I will hang around longer next time. The snippet did exactly what I needed, thank you. Is there a reference which lists the variables I have access to? I looked and can't locate one.

Thanks again.

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: Data displayed on thank you page via conditional referencing event_type_id
February 25, 2009, 09:13:06 am
the variables exposed are different for different pages. easiest way is to use smartyDebug=1 GET parameter in url

check

http://wiki.civicrm.org/confluence/display/CRMDOC/Debug+Tools

lobo

« Last Edit: February 25, 2009, 10:10:36 am by Dave Greenberg »
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) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Data displayed on thank you page via conditional referencing event_type_id

This forum was archived on 2017-11-26.