Has anyone been successful getting a toolbar button to get a fly-out panel to work in a page? I have the toolbar button showing up but i can’t figure out how to tie it into my side-panel content.
With “toolbar button” do you mean the standard Concrete toolbar that’s displayed when users are logged in?
If so, I developed a package that adds toolbar buttons that open panels.
You have to register buttons this way:
$checker = new Checker($page);
if ($page->getCollectionPath() === '/dashboard/blocks/stacks') {
if (!$checker->canViewPage()) {
return;
}
} else {
if (!$page->isEditMode() || !$checker->canEditPageContents()) {
return;
}
$menu = $this->app->make('helper/concrete/ui/menu');
$menu->addPageHeaderMenuItem(
'export',
$this->pkgHandle,
[
'icon' => 'download',
'label' => t('Export as XML'),
'position' => 'left',
'href' => false,
'linkAttributes' => [
'data-launch-panel' => 'blocks_cloner-export',
'title' => t('Export as XML'),
And you have to register your panels this way:
;(function() {
'use strict';
document.addEventListener('DOMContentLoaded', function() {
if (typeof ConcretePanelManager === 'undefined') {
return;
}
ConcretePanelManager.register({
overlay: false,
identifier: 'blocks_cloner-import',
position: 'left',
url: CCM_DISPATCHER_FILENAME + '/ccm/blocks_cloner/panels/import?cID=' + CCM_CID,
pinable: false,
});
});
})();
You also need controllers and views of course, see that package souce code for more details.
Thank you!!! I will check this out this is a great example. (but then again you knew that)