I need to add a custom button to the toolbar inside of a system plugin, near 'save', 'save & close' and 'close' buttons. How can I achieve it?


You can add custom button by working on event onAfterRender() and add your html/js code in the content.

Below is a sample code snippet you can add your code in this one.

function onAfterRender()
        $option = Jfactory::getApplication()->input->get('option', '');
        if($option != 'com_config'){
            return true;

        // Only render for HTML output
        if (JFactory::getDocument()->getType() !== 'html' ) { return; }

        //ADD HTML and JavaScript for your custom button
        $html = '';

        $body = JFactory::getApplication()->getBody(false);
        $body = str_replace('</body>', $html.'</body>', $body);
        return true;

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.