1

I pull out some important at-a-glance information on contact summary pages - membership info, relationships via related cases, etc.

At the moment i override contentsummary.tpl and do my API calls with javascript - page loads, my things fire, then for some, returned values are used in a second API call.

This is slow and feels embarrassingly cludgy!

What should i be using for this?

1

Try the Contact Summary Layout Editor that lets you restructure the contact summary. There are a couple of other extensions that link with it that can provide blocks - see the readme.

  • I don't really need to restructure the layout as such, it would more be something like the linked relationship block extension - am i right in thinking that it will be doing its API call(s) alongside the rest of the load, so will be faster in that regard? – user3016811 Nov 22 '18 at 11:51
  • 1
    It would be querying the data serverside and delivering it as part of the page. There is probably less lag from when the page starts to display to when your JS has loaded, but at the expense of more time building the page before it gets sent to the browser. But there is increasing use of AJAX - pulling data via javascript is a popular approach. Optimising the api calls (only returning what you actually need) might speed things up for you. – Aidan Nov 22 '18 at 16:48
1

Have you looked at creating a module extension and using hook_civicrm_summary
https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_summary/

Module creation is described here https://docs.civicrm.org/dev/en/latest/extensions/civix/#generate-module

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.