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 Andrey Yatsenko 2 months, 3 weeks ago.

The forum will run in the read-only mode starting from March 1. 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

    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
    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
    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 2 months, 3 weeks ago by  saikatcdac.
    #41023
    Andrey Yatsenko
    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)

You must be logged in to reply to this topic.

You will be redirected to [title]. Would you like to continue?

Yes No