I´m trying create buttons in ResultTasks.tpl for "show on map" and "export". This actions are in dropdown list with select named "task". I first tried duplicate the select, but it worked only last select, the first select redirect only to print page. Is possible to make separate buttons for these actions?


By "buttons", I assume you mean the buttons referenced in the screenshot below.

It's not recommended to edit the .tpl files directly - it's hard to maintain, and will be overwritten any time you upgrade. Instead, it's preferable to use an extension with hook_civicrm_links, which allows you to inject your own links.

My Fast Action Links extension also provides a framework for adding links; you can either use it directly if it makes sense, or use it as an example of how to inject links to search results.

enter image description here

  • No, I mean the top dropdown action. Here is what i mean. ctrlv.cz/WDTp And I have custom_templates, so it will not be overwritten. :) But i go to look to hook_civicrm_links. Thank you. :) Jan 22 '19 at 16:17
  • Those are "search tasks", and "export" and "show on map" should already be present. But you can add new search tasks with hook_civicrm_searchTasks. Also note that maintaining custom templates creates a lot of maintenance work. You have to compare your changes against new templates on every upgrade and migrate your changes - hooks are much less work to maintain! Jan 22 '19 at 21:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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