Warning: You are browsing the documentation from version 4 to 10 of Pimcore. Please visit https://pimcore.com/docs/platform/ for the latest versions of Pimcore.
Version: Edit on GitHub

Add a Button to Object Editor

Sometimes it might be useful to add additional buttons to the object editor (or any other editor) in Pimcore Backend Interface. In terms of product for example to add a download button for a product data sheet - like the following screen shot shows.



  1. Create a bundle with a Pimcore Backend Interface java script extension as described here.

  2. Implement a listener for the postOpenObject event like follows:

document.addEventListener(pimcore.events.postOpenObject, (e) => {
    if (e.detail.object.data.general.o_className === 'ShopProduct') {
            text: t('show-pdf'),
            iconCls: 'pimcore_icon_pdf',
            scale: 'small',
            handler: function (obj) {
                //do some stuff here, e.g. open a new window with an PDF download
            }.bind(this, e.detail.object)