Answers.Body: <p>First think its not a good practice to over-ride any core files specially templates when you can use jQuery to play around. </p>
  
  <p>You can use buildform() hook to add button(s) to a form and the pop up window will recognise the button based on class or attribute and append it on popup form</p>
  
  <p>HTH</p>
  
  <p>Pradeep</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-11T02:14:04.803Z
Answers.Text: Thanks @Pradeep, can you provide an example or link of adding button via buildform hook and also of how popup will recognise a class
Answers.UserDisplayName: harshal
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-13T14:33:21.243Z
Answers.Text: Hi , how to add buttons using buildForm() ?
Answers.UserDisplayName: harshal
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-13T21:08:09.100Z
Answers.Text: You will need to over-ride the button to include existing + new button through buildform. The other option is to add button using smarty in tpl file using below snippet
  
  {crmButton p='civicrm/request' q="action=browse&reset=1&gid=$gid" icon="th-list"}{ts}Request for Approval{/ts}{/crmButton}
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-15T01:33:38.373Z
Answers.Text: What does q in the above html means? {crmButton p='civicrm/request' q="action=browse&reset=1&gid=$gid" icon="th-list"}{ts}Request for Approval{/ts}{/crmButton} , I need to add redirection to current page as my url added in 'p' is 'event-workflow/request'
Answers.UserDisplayName: harshal
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-10T15:47:04.657Z
Answers.LastActivityDate: 2019-01-10T15:47:04.657Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>I have added a button in the EventInfo.tpl</p>
  
  <pre><code> &lt;div class="crm-submit-buttons"&gt;
             &lt;div style="display:none"&gt;{include file="CRM/common/formButtons.tpl" location="bottom"}&lt;/div&gt;
             &lt;span class="approved-logic crm-button crm-button-type-upload"&gt;
              &lt;button&gt;Approve&lt;/button&gt;
          &lt;/span&gt;
             &lt;span class="request-approval crm-button crm-button-type-upload"
              &lt;button&gt;Request for Approval&lt;/button&gt;
  
          &lt;/div&gt;
  </code></pre>
  
  <p>But when I click on Add Event under Manage Events, I see a popup which does not <br>show my button but when I click on add event and add it to new window it shows <br>the button, how can I make sure it works on both the places<br>
  1) Popup 
  <a href="https://i.sstatic.net/tE553.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/tE553.png" alt="enter image description here"></a>
  2) New Window(which is showing currently)
  <a href="https://i.sstatic.net/Fc9zG.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Fc9zG.png" alt="enter image description here"></a>
  <a href="https://i.sstatic.net/sSDbp.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/sSDbp.png" alt="enter image description here"></a></p>
  
Tags: <civievent>
Title: How to add additional action buttons in a civicrm Add Event form?
ThreadText: # How to add additional action buttons in a civicrm Add Event form?
  
  (Asked by: username_0 on 2019-01-10)
  
  I have added a button in the EventInfo.tpl
   
             {include file="CRM/common/formButtons.tpl" location="bottom"}
             
              Approve
          
             Request for Approval
  
          
  
  But when I click on Add Event under Manage Events, I see a popup which does not show my button but when I click on add event and add it to new window it shows the button, how can I make sure it works on both the places
  1) Popup 
  
  2) New Window(which is showing currently)
  
  **Tags:** civievent
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-01-10. Score: 3
  
  First think its not a good practice to over-ride any core files specially templates when you can use jQuery to play around.
  
  You can use buildform() hook to add button(s) to a form and the pop up window will recognise the button based on class or attribute and append it on popup form
  
  HTH
  
  Pradeep
  
  > **Comments:**
  > **username_0**: Thanks @Pradeep, can you provide an example or link of adding button via buildform hook and also of how popup will recognise a class  
  > **username_0**: Hi , how to add buttons using buildForm() ?  
  > **username_1**: You will need to over-ride the button to include existing + new button through buildform. The other option is to add button using smarty in tpl file using below snippet  {crmButton p='civicrm/request' q="action=browse&reset=1&gid=$gid" icon="th-list"}{ts}Request for Approval{/ts}{/crmButton}  
  > **username_0**: What does q in the above html means? {crmButton p='civicrm/request' q="action=browse&reset=1&gid=$gid" icon="th-list"}{ts}Request for Approval{/ts}{/crmButton} , I need to add redirection to current page as my url added in 'p' is 'event-workflow/request'  
  
  ---
  
  