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) »
  • Discussion »
  • Extensions (Moderators: mathieu, totten, kasiawaka) »
  • Civicrm Extensions and templates, multiple Summary.extra.tpl
Pages: [1]

Author Topic: Civicrm Extensions and templates, multiple Summary.extra.tpl  (Read 1051 times)

j.vos

  • I’m new here
  • *
  • Posts: 13
  • Karma: 0
  • CiviCRM version: 4.2
  • CMS version: Drupal
  • MySQL version: 5
  • PHP version: 5
Civicrm Extensions and templates, multiple Summary.extra.tpl
March 07, 2014, 02:18:53 am
I have two extensions with a template called Summary.extra.tpl in the folder /CRM/Page/View.
But only one works. If I disable one extension the other one works and visa versa.

Is it possible to have multiple Summary.extra.tpl with multiple extensions?

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Civicrm Extensions and templates, multiple Summary.extra.tpl
March 07, 2014, 06:44:04 am
No.
Really .extra.tpl is a method that should not be used by extensions because it can't be used that way.
Hooks and regions are better. Try injecting your content using CRM_Core_Region instead.
Try asking your question on the new CiviCRM help site.

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Civicrm Extensions and templates, multiple Summary.extra.tpl
March 07, 2014, 11:26:18 am
Coleman, agree with your recommendation. Leads to another thought: could we do something with these do's and don'ts on the Documentation wiki?
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

j.vos

  • I’m new here
  • *
  • Posts: 13
  • Karma: 0
  • CiviCRM version: 4.2
  • CMS version: Drupal
  • MySQL version: 5
  • PHP version: 5
Re: Civicrm Extensions and templates, multiple Summary.extra.tpl
March 10, 2014, 12:52:59 am
Thanks for your answer.

It is very helpfull.

I used the hook_civicrm_summary

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
Re: Civicrm Extensions and templates, multiple Summary.extra.tpl
May 12, 2014, 12:06:13 pm
I noticed this and created myself an issue for my extension here:
https://github.com/iATSPayments/com.iatspayments.civicrm/issues/1

But when trying to implement it, I'm running into the issue that there isn't any region to add into, as far as I can see. Since I'm just adding some javascript, I thought I could even better just use
Code: [Select]
CRM_Core_Resources::singleton()->addScriptFile('com.example.foo', 'bar.js');but that's not great because the page I want to add stuff to is just a snippet pulled in via ajax, which means I'd have to load it for the parent page, which is starting to sound inefficient and error prone (i.e. I want that javascript to be more tightly attached to the snippet).

Any suggestions? I'm trying to add my extra stuff to the Contribution tab of the contact summary page.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Civicrm Extensions and templates, multiple Summary.extra.tpl
May 12, 2014, 03:07:39 pm
I believe the head and body regions are always available. I have (ab)used the body one to stuck some html at the bottom. with a oneliner jQuery to move it where I need it to be displayed.

-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
Re: Civicrm Extensions and templates, multiple Summary.extra.tpl
May 14, 2014, 06:02:12 am
Okay, that's good to know, thanks. I'll have to see if it also works for ajax-loaded snippets ...

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Extensions (Moderators: mathieu, totten, kasiawaka) »
  • Civicrm Extensions and templates, multiple Summary.extra.tpl

This forum was archived on 2017-11-26.