2

I want to have some additional data as part of my CiviCRM events, that is structured and available to Drupal Views, so I've added a couple of custom fields for Events, and I'm using those. On the public facing event information page, the default rendering of these fields is the same as in the back office, and so they look pretty out of place.

If I edit the EventInfo.tpl file it looks like it is simply pulling in the custom data with the line (line 225 in CiviCRM 4.7.24)

    {include file="CRM/Custom/Page/CustomDataView.tpl"}

I'm assuming that if I edit/override that template file it may well affect the presentation of all custom data fields right across CiviCRM.

So I guess the question is: what's the optimal way to modify the way that just these two custom fields are presented on the public facing event information page without impacting on other custom field presentation elsewhere?

As a linked supplementary question, one of these custom fields is for an event image that I can then present via a Drupal View (all my events have an image associated, and although I can of course simply include one inline through the event description field I can't subsequently access that file in Drupal Views and display itinerary a block, for example, elsewhere on the site. I'm thinking that I can't be the first person to want to re-use a CiviCRM Event image in this way. How do other people approach this?

1 Answer 1

3

In newer versions of CiviCRM (around 4.7.20 and higher) you can mark a custom field set as not public. This will hide the custom field set from your event page. Then you could use a buildForm hook to include a template of your choice; see the CiviCRM dev guide Resources Reference for details.

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.