Answers.Body: <p>I am assuming you want to add some stuff at the bottom of the activity page, correct?</p>
  
  <p>First of all, you need to establish if you are adding to a civicrm page or form. You can do a little test with the hook buildForm (see <a href="https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_buildForm/" rel="nofollow noreferrer">https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_buildForm/</a>) and check the <strong>formName</strong> or with the hook pageRun (see <a href="https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_pageRun/" rel="nofollow noreferrer">https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_pageRun/</a>) and check the name of the page.</p>
  
  <p>Once you have established which hook you need to use you can add the template with the CRM_Core_Region.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-10T11:10:13.413Z
Answers.Text: Thank you @erikh-civicoop, I think _hook_civicrm_buildForm_ is the right hook for me, I am testing with it. You are correct that I want to add some extra stuff at the bottom of the activity page.
Answers.UserDisplayName: Arun Singh
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-10T09:12:10.137Z
Answers.LastActivityDate: 2018-07-10T09:12:10.137Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>I want to add a new template part to the activity edit &amp; view page, I have been trying number of hooks to do it but could not figure out which one best to use.</p>
  
  <p><a href="https://i.sstatic.net/SctMv.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/SctMv.png" alt="enter image description here"></a></p>
  
  <p>I am trying to do something similar to what is explained here <a href="https://youtu.be/lrk8X_jt0wU?list=PLjSU7YfE0E00Xv9b_VqwjDjAcFUVtR8k5&amp;t=837" rel="nofollow noreferrer">https://youtu.be/lrk8X_jt0wU?list=PLjSU7YfE0E00Xv9b_VqwjDjAcFUVtR8k5&amp;t=837</a> but for activity edit &amp; view pages.</p>
  
  <pre><code>function _myactivity_civix_civicrm_summary($contactID, $content){
  CRM_Core_Region::instance('page-body')-&gt;add([
      'template' =&gt; 'templates/myactivity.tpl'
  ]);
  }
  </code></pre>
  
  <p>Any suggestion or better approach would be great help.</p>
  
  <p>Thanks in advance :)</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-07-10T06:44:30.630Z
Comments.Text: so do you want to update the activity with specific word in the description once it is completed - Right?
Comments.UserDisplayName: Ramesh - ARTECH Consultancy
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-07-10T11:13:39.350Z
Comments.Text: @ramesh - No, I am looking for correct hook or method to embed additional template files and display my extra stuff on the activity page.
Comments.UserDisplayName: Arun Singh
Tags: <extension><hooks><civix>
Title: Add new smarty template to an existing page
ThreadText: # Add new smarty template to an existing page
  
  (Asked by: username_0 on 2018-07-10)
  
  I want to add a new template part to the activity edit & view page, I have been trying number of hooks to do it but could not figure out which one best to use.
  
  [![enter image description here](https://i.sstatic.net/SctMv.png)](https://i.sstatic.net/SctMv.png)
  
  I am trying to do something similar to what is explained here <https://youtu.be/lrk8X_jt0wU?list=PLjSU7YfE0E00Xv9b_VqwjDjAcFUVtR8k5&t=837> but for activity edit & view pages.
  
  ```
  function _myactivity_civix_civicrm_summary($contactID, $content){
  CRM_Core_Region::instance('page-body')->add([
      'template' => 'templates/myactivity.tpl'
  ]);
  }
  
  ```
  
  Any suggestion or better approach would be great help.
  
  Thanks in advance :)
  
  **Tags:** extension, hooks, civix
  
  > **Comments:**
  > **username_1**: so do you want to update the activity with specific word in the description once it is completed - Right?  
  > **username_0**: @username_1 - No, I am looking for correct hook or method to embed additional template files and display my extra stuff on the activity page.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2018-07-10. Score: 3 | Accepted answer
  
  I am assuming you want to add some stuff at the bottom of the activity page, correct?
  
  First of all, you need to establish if you are adding to a civicrm page or form. You can do a little test with the hook buildForm (see <https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_buildForm/>) and check the **formName** or with the hook pageRun (see <https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_pageRun/>) and check the name of the page.
  
  Once you have established which hook you need to use you can add the template with the CRM\_Core\_Region.
  
  > **Comments:**
  > **username_0**: Thank you @username_2-username_2, I think _hook_civicrm_buildForm_ is the right hook for me, I am testing with it. You are correct that I want to add some extra stuff at the bottom of the activity page.  
  
  ---
  
  