Skip to content

Instantly share code, notes, and snippets.

@anyt
Created September 19, 2016 18:15
Show Gist options
  • Save anyt/2f4f70c36aa100837634d3f77ee19840 to your computer and use it in GitHub Desktop.
Save anyt/2f4f70c36aa100837634d3f77ee19840 to your computer and use it in GitHub Desktop.
Add button to "More Actions" dropdown
{{ UI.clientButton({
'dataUrl': path(
'acme_demo_foo_route', {
entityClass: oro_class_name(entity, true),
entityId: entity.id
}),
'aCss': 'no-hash',
'iCss': 'icon-comment-alt',
'dataId': entity.id,
'label': 'acme_demo.contact.action.foo'|trans,
'widget': {
'type': 'dialog',
'multiple': false,
'refresh-widget-alias': 'activity-list-widget',
'options': {
'alias': 'foo-dialog',
'dialogOptions': {
'title': 'acme_demo.contact.action.foo'|trans,
'allowMaximize': true,
'allowMinimize': true
}
}
}
}) }}
acme_demo_foo_button:
template: AcmeDemoBundle:Contact:fooButton.html.twig
applicable: "@oro_ui.placeholder.filter->isInstanceOf($entity$, %orocrm_contact.entity.class%)"
acl: [orocrm_contact_view]
acme_demo_foo_link:
template: AcmeDemoBundle:Contact:fooLink.html.twig
applicable: "@oro_ui.placeholder.filter->isInstanceOf($entity$, %orocrm_contact.entity.class%)"
acl: [orocrm_contact_view]
services:
acme_demo.widget_provider.actions:
parent: oro_ui.widget_provider.action_button.abstract
arguments:
- acme_demo_foo_button
- acme_demo_foo_link
tags:
- { name: oro_ui.view_action_provider, group: activity, priority: -100 } # change priority to render button at the right place
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment