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) »
  • Custom fields for event showing up during online registration
Pages: [1]

Author Topic: Custom fields for event showing up during online registration  (Read 4599 times)

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Custom fields for event showing up during online registration
March 09, 2008, 02:24:40 pm
I want to add custom fields to events (for analytical, internal purposes) but these show up in the event description during online registration.

The documented options are:
  • Create a custom screen, by changing the template for displaying events, but then the custom fields won't be visible to users within my organisation
  • Create a custom profile screen, but profiles don't appear to be currently supported for events

Other options appear to be:
  • Use CSS to prevent the fields displaying during online rego, but then the data is "in the wild" albeit (usually) invisible
  • Change the logic of the template to decide not to display custom fields during online rego - is there a status call I can make to discern this?

Could someone please offer some advice?

Thanks,
Ken

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: Custom fields for event showing up during online registration
March 09, 2008, 02:37:02 pm

Ken:

There is a difference between custom fields and profiles. You can read more about profiles and custom fields on the wiki to get a better understanding

You can add one or more event custom fields to a profile. You do not need to add all the event custom fields to the profile. You can expose a profile to the online event registration form.

If the above does not make sense, please reproduce your scenario on our demo machine, and we can get more specific based on that :)

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

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: Custom fields for event showing up during online registration
March 17, 2008, 10:57:31 pm
Lobo,

Thanks for the advice. I tried the online demo, but it's behaviour is similar to my test site (which is 2.0beta1).

When I try to create a profile I can only add fields from Individuals, Households, Organisations, Participants, Contributions, and Memberships - but not Events.

So it doesn't seem that Profiles are (currently) the way to go. Or am I missing something?

Ken

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: Custom fields for event showing up during online registration
March 18, 2008, 07:35:00 am

ken:

can u clarify the following:

1. Do you want to add fields and collect data for an event or to a participant record?

2. I do not think event custom data shows up in an online registration page. If this is wrong, can you show me the url on demo which displays this

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

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: Custom fields for event showing up during online registration
March 24, 2008, 03:29:11 pm
Dear Lobo,

In response to your questions ...
  • The custom fields I am adding are attached to the event and not the participant
  • On the demo site, I've added the custom group "Event analysis" for events, with 2 fields, "Success" (Yes/No) and "Improvements for next time" (Alphanumeric). I'm not sure how to set up online event registration on the demo site, but when I test-drive one of the events ("Goldfish feeding workshop") the custom fields appear.

Thanks,
Ken

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: Custom fields for event showing up during online registration
March 24, 2008, 04:16:53 pm

Can you gimme the demo url you have for the goldfish event. I cannot seem to find it on the demo site

thanx

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

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: Custom fields for event showing up during online registration
April 03, 2008, 02:46:08 am
Dear Lobo,

The demo site gets reset so the fields I set up have gone. Here's a procedure to reproduce the issue ...
  • Administer CiviCRM > Custom Data > New group of custom fields
  • Group name = "Analysis"; Used for = "Events" (any); Save
  • Administer CiviCRM > Custom Data > Group title = "Analysis" > View and edit custom fields > there are no custom fields, add one
  • Field Label = "Secret stuff"; Save
  • CiviEvent > Manage Events > Event = {any in list} > Test drive
  • The internal information is shown, but I don't want this custom data made public
  • so, let me try and create a profile for the front-end so the internal information is not shown ...
  • Administer CiviCRM > CiviCRM profile > New CiviCRM profile
  • Profile name = "Show no secrets"; Save
  • Administer CiviCRM > CiviCRM profile > Profile title = "Show no secrets" > View and edit fields > No fields, add one now
  • Field name = ????
  • "Field name" doesn't include an option for fields for Events! So I take it then that profiles don't (yet) work for Events, and I can't use a profile to select which Event fields get shown and which are not.

Hope this helps explain my issue,
Ken

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: Custom fields for event showing up during online registration
April 03, 2008, 01:42:26 pm

hey ken:

thanx for the detailed instructions. much appreciated, makes it much easier for us to follow, debug and figure out whats happening.

1. So with event custom data, we show ALL the custom fields. We had no easy way of restricting it to a smaller set. If you dont want ANY custom fields to be displayed, the easiest way is to customize the template:

http://wiki.civicrm.org/confluence/display/CRMDOC/Customize+Built-in+and+Profile+Screens

the template to customize is: CRM/Event/Page/EventInfo.tpl, line 86

Code: [Select]
    {include file="CRM/Contact/Page/View/InlineCustomData.tpl" mainEditForm=1}

You can delete or comment out the above line

2. an event registration form creates a participant object. So you need to create custom data for type Participant if you want it to appear in the online registration form.

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

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: Custom fields for event showing up during online registration
April 08, 2008, 05:41:54 pm
Thanks Lobo (or do you prefer Donald?),

What I'd like to be able to do is to see the custom fields on the backend, but not on the registration screen.

That is, change the code to something like ...

Code: [Select]
if (this is NOT the registration form) then
    {include file="CRM/Contact/Page/View/InlineCustomData.tpl" mainEditForm=1}
end if

Is there a condition I can test that distinguishes between the front end and back end display? Or between what is displayed to the public versus registered users?

Thanks again,
Ken

tzura

  • Guest
Re: Custom fields for event showing up during online registration
May 07, 2008, 03:56:24 pm
I went through this as well.  What I ended up doing was turning off the 'access all custom data' for anonymous in the Drupal access control and then using the CiviCRM ACL functionality to only allow 'ADMINISTRATOR' to see data from certain custom data groups.  Unfortunately, this means I also need to make an ACL rule for each custom data group that I want 'EVERYONE' to be able to view/edit.

Adds a bit to the event creation process, but it was the only way I could fix it adequately.

Hope this helps.

-Timothy

ken

  • I live on this forum
  • *****
  • Posts: 916
  • Karma: 53
    • City Bible Forum
  • CiviCRM version: 4.6.3
  • CMS version: Drupal 7.36
  • MySQL version: 5.5.41
  • PHP version: 5.3.10
Re: Custom fields for event showing up during online registration
April 19, 2009, 12:35:40 am
Just for the record, I've discovered how to hide information from front-end users and show it to back-end users.

In a local copy of the template, put ...

    {if ! $config->userFrameworkFrontend}

... before the stuff you want to hide, and ...

    {/if}

... afterwards.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Custom fields for event showing up during online registration

This forum was archived on 2017-11-26.