LemonStand Documentation

cms:onExtendPagesToolbar event

The cms:onExtendPagesToolbar event allows to add new buttons to the toolbar above the page list (CMS/Pages page) in the Administration Area. The event handler should accept a single parameter - the controller object, which you can use for rendering a partial, containing new buttons. The following example adds a new button to the toolbar.

public function subscribeEvents()
{
  Backend::$events->addEvent('cms:onExtendPagesToolbar', $this, 'extend_toolbar');
}
 
public function extend_toolbar($controller)
{
  $controller->renderPartial(PATH_APP.'/modules/cmsext/partials/_toolbar.htm');
}

// Example of the _toolbar.htm partial

<div class="separator">&nbsp;</div>
<?= backend_ctr_button('Some button', 'new_document', '#') ?>

Next: cms:onAfterDisplay event
Previous: cms:onGetPageNavigationVisibility event
Return to Handling LemonStand events