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

1 Answer 1

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

4
  • 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, 2019 at 2:14
  • Hi , how to add buttons using buildForm() ?
    – harshal
    Jan 13, 2019 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} Jan 13, 2019 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, 2019 at 1:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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