1

Currently, I am using CiviCRM 4.7 version and integrated with Drupal 7.

In the Event registration page sections like Event attachment, event committee, Event Contact showing as default. Please refer to the screenshot.

enter image description here

Question is, Can we hide those sections on the Event registration page for each event. If they don't have any information . if they don't have any information.

Please guide me how to achieve this.

If it is possible in a new version of CiviCRM 5.8, Please guide me how to achieve this.

2

You can try this css trick

div:empty {
   display: none;
}

Or you can try using jQuery

$('div.section:empty').hide();
  • Since I have multiple fields, CSS and jQuery will be complicated for me. – sharaths Jan 15 at 11:48
  • I haven't tried this, but it is applied to divs that meet the criteria of being empty rather than individual fields. – Aidan Jan 15 at 11:53
0

Are those fields visible on the event information page? If so you could uncheck the public setting at the custom field. You could do this by going to Administer --> Customize Data and Screens --> Custom Fields and then go to the Custom Fields of the custom group Attachments and for each field uncheck the public setting.

  • yes, those fields are visible on the event information page. Is this solution hide those fields when they don't have information?. What I want is When they have information I need to show those fields in the event information page. – sharaths Jan 15 at 9:31
  • I followed the steps as you suggested. If I uncheck the public settings. If those fields have the information it is not showing in the event information page. – sharaths Jan 15 at 9:53
  • Yes, this setting is useful if you have administrative custom fields that you don't want to show on the public event pages, but it does not depend on whether there is data to show so it doesn't do quite what you need. The css method below might suit you better. – Aidan Jan 15 at 11:34
  • @Aidan Since I have multiple fields, CSS and jQuery will be complicated for me. Is there any other options or configurations to achieve this. – sharaths Jan 15 at 11:49
0

As you are using Drupal you 'could' stop using the standard civicrm pages for this and build it out in Views, and then you can set the Fields in the View disply to not show if they are empty

(not saying this is desirable or 'easy' but does not require code, css or jquery, but it does seem like a valid answer)

0

How about using the ‘Complete Description’ field in the ‘Info and Settings’ section when configuring the event?

Enter all the info you wish to display, including documents using the HTML editor -

enter image description here

And use the email and phone fields in the ‘Event Location’ section to display event contact information –

enter image description here

You then have full control over what to display with no empty values -

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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