SuluArticleBundle: add custom tool bar action to article list #639
ewmSahnoun
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
hi,
i want to add a custom tool bar action , the goal is set multiple articles to unpublished with one action without entering in each article and set to unpublished
so any idea how to add because am trying to use tool bar action of sulu sulu/sulu-demo#81
but it doesn't work, its give me this error Attempted to call an undefined method named "addToolbarActions" of class "Sulu\Bundle\AdminBundle\Admin\View\TabViewBuilder".
<?php declare(strict_types=1); namespace App\Admin; use Sulu\Bundle\AdminBundle\Admin\Admin; use Sulu\Bundle\AdminBundle\Admin\View\ListViewBuilderInterface; use Sulu\Bundle\AdminBundle\Admin\View\ToolbarAction; use Sulu\Bundle\AdminBundle\Admin\View\ViewCollection; use Sulu\Bundle\ArticleBundle\Admin\ArticleAdmin; class AppAdmin extends Admin { public function configureViews(ViewCollection $viewCollection): void { if ($viewCollection->has(ArticleAdmin::LIST_VIEW)) { /** @var ListViewBuilderInterface $contactListViewBuilder */ $contactListViewBuilder = $viewCollection->get(ArticleAdmin::LIST_VIEW); $contactListViewBuilder->addToolbarActions([ new ToolbarAction('app.alert_names', ['disable_for_empty_selection' => true]), ]); } } public static function getPriority(): int { return ArticleAdmin::getPriority() - 1; } }
thank for help
Beta Was this translation helpful? Give feedback.
All reactions