1

I have a custom field set with fields used for managing extra data on the event. I want one of the custom fields' value to be shown in its registration form. What is the Smarty expression to put in the 'Register.tpl' file so that I could show this custom field in the registration form. Clarification - this custom field is not on a Participant, but on the whole event.

1
  • Just want to be clear that you are talking about Event and not Participant. Custom Participant fields can be set to show on Registration pages through Profiles. Custom Event fields will (out of the box) show on Event Info pages. You may already understand this but noting for others who may read this.
    – petednz - fuzion
    Commented Apr 22, 2018 at 19:33

1 Answer 1

3

I guess the custom fields for Event are not available in smarty on Event registration form but are available on Event information page. But you can retrieve the custom fields for an Event using api. You can use below snippet in tpl file to get custom field data

{crmAPI var='result' entity='Event' action='getsingle' return="custom_81,custom_82" id=$event.id}

The return value specifies list of custom fields that i would like to retrieve. You can remove return option if you would like to get all the Event data including custom fields.

To print you can use {$result} variable eg. in above case i would use {$result.custom_81} and {$result.custom_8}

HTH

Pradeep

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.