4

I find that in many case some of the default fields on activities are not relevant. what's the best approach to editing the templates so that I can control what fields appear on activity forms?

2

Graham, there are loads of tutorials on how to use jQuery. The CiviCRM approach would be:

  1. Identify the ID of the field to hide using FireBug (or the inspect element function of your browser)
  2. Add a template with the jQuery required to hide the identified id's which will be something like this:
{literal}
  
    cj(document).ready(function() {
      cj('#firstTestID').hide();
      cj('#secondTestID').hide();
    });
  
{/literal}
  1. Add a hook in an extension to add the template with your hides to the template with something like this statement:
            CRM_Core_Region::instance('page-body')->add(array('template' => 'GroupProtect.tpl'));
    OR add the jQuerys to a .extra template (in the documentation https://wiki.civicrm.org/confluence/display/CRMDOC/Page+Templates)

Does this help?

  • Thanks Erik. I guess my goal here is in part to provide a useful resource and a set of pointers. Your input is invaluable, as always. – Graham Feb 3 '16 at 14:34

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.