OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – Programming Questions Add button to view in another bundle?

This topic contains 6 replies, has 6 voices, and was last updated by  Andrey Yatsenko 4 years, 4 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #33498

    Jowo
    Participant

    Can a bundle add a button to another bundles view and make it function?

    For example in OroCRM we have Accounts view and the button “Export Grid”. Let us pretend it does not exist in the Account bundle.

    Is it possible to create another bundle, include this button there and create the export grid functionality?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
    Replies
  • #33499

    Yevhen Shyshkin
    Participant

    Hello, Jowo.

    Answer on your question really depends on where you want to put a new button.

    If you need to add a grid action (like “Export grid”) then you have to extend/override exisitng grid and add/replace required actions.

    If you need to add a general button (like “Create account”) then you have to use placeholders (e.g. this one). In fact there are lots of placeholders in default templates and you can use it to inject your code into any page.

    If you need to customize specific page (e.g. view of account) and there are no appropriate placeholder you can extend and override existing template, and put a new button into appropriate block.

    I hope it will help you. If you have some more specific case that you are going to implement – feel free to put it here, we can discuss it.

    #33500

    Xavier
    Participant

    Hello Jowo et Yevhen,

    I use the technic with placeholders to add button in page view
    Juste adding 2 files in my specific bundle :

    • ../MyBundleBundle/Resources/config/oro/placeholders.yml
    • ../MyBundle/Resources/views/specific_rep/buttons.html.twig

    And It works perfectly :D

    Thank you Yevhen

    #40985

    saikatcdac
    Participant

    Hi Xavier

    How you are showing the button only on view page or top of the grid view but not in create page? Please help me in this regard.

    Thanks
    Saikat

    #40993

    Michael
    Keymaster

    See https://github.com/oroinc/platform/blob/3.1.15/src/Oro/Bundle/ActionBundle/Resources/config/oro/placeholders.yml – there are different placeholders available for different kinds of pages.

    #40997

    saikatcdac
    Participant

    Hi Michael,

    Thanks for your reply, But it’s not working for me as per that doc my code is at below. Create button is showing in create page too which i don’t want. Please tell me where i am wrong?

    • This reply was modified 4 years, 4 months ago by  saikatcdac.
    #41023

    Andrey Yatsenko
    Moderator

    Take a look at placeholder conditions in “applicable” property:
    https://github.com/oroinc/platform/tree/3.1.15/src/Oro/Bundle/UIBundle#introduction-to-placeholders

Viewing 6 replies - 1 through 6 (of 6 total)

The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.

Back to top