2

I have added a button in the EventInfo.tpl

 <div class="crm-submit-buttons">
           <div style="display:none">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
           <span class="approved-logic crm-button crm-button-type-upload">
            <button>Approve</button>
        </span>
           <span class="request-approval crm-button crm-button-type-upload"
            <button>Request for Approval</button>

        </div>

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 enter image description here 2) New Window(which is showing currently) enter image description here enter image description here

4

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

  • Thanks @Pradeep, can you provide an example or link of adding button via buildform hook and also of how popup will recognise a class – harshal Jan 11 at 2:14
  • Hi , how to add buttons using buildForm() ? – harshal Jan 13 at 14:33
  • 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} – Pradeep Nayak Jan 13 at 21:08
  • 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' – harshal Jan 15 at 1:33

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.