markocupic/contao-custom-global-operation

扩展Contao后端全局操作导航

1.0 2023-02-09 20:22 UTC

This package is auto-updated.

Last update: 2024-09-16 22:33:27 UTC


README

Alt text

在Contao后端中查看许多全局操作的更多概览

如果Contao后端模块拥有许多全局操作,导航可能会变得难以理解。

这个Contao扩展可以帮助您。不同的菜单项可以按主题分组并有序输出。

Alt text

配置

配置通过Contao的DCA进行,请注意以下两个键

custom_glob_op: 通过custom_glob_op => true激活菜单项的自定义输出。通过数组custom_glob_op_options => []可以进一步配置菜单项或将其排除。

	'global_operations' => [
        'all'                          => [
            'href'       => 'act=select',
            'class'      => 'header_edit_all',
            'attributes' => 'onclick="Backend.getScrollOffset()" accesskey="e"',
        ],
        'glob_operation_one' => [
            'href'                   => 'action=glob_operation_one',
            'class'                  => 'glob_operation_one',
            'icon'                   => 'bundles/myawesomecontaobundle/icons/file-word-regular.svg',
            'attributes'             => 'onclick="Backend.getScrollOffset()" accesskey="e"',
            'custom_glob_op'         => true,
            'custom_glob_op_options' => ['add_to_menu_group' => 'my_menu_one', 'sorting' => 10],
        ],
        'glob_operation_two' => [
            'href'                   => 'action=glob_operation_two',
            'class'                  => 'glob_operation_one',
            'icon'                   => 'bundles/myawesomecontaobundle/icons/file-excel-regular.svg',
            'attributes'             => 'onclick="Backend.getScrollOffset()" accesskey="e"',
            'custom_glob_op'         => true,
            'custom_glob_op_options' => ['add_to_menu_group' => 'my_menu_one', 'sorting' => 20],
        ],
        'glob_operation_three' => [
            'href'                   => 'action=glob_operation_three',
            'class'                  => 'glob_operation_one',
            'icon'                   => 'bundles/myawesomecontaobundle/icons/file-pdf-regular.svg',
            'attributes'             => 'onclick="Backend.getScrollOffset()" accesskey="e"',
            'custom_glob_op'         => true,
            'custom_glob_op_options' => ['add_to_menu_group' => 'my_menu_two', 'sorting' => 30],
        ],
	],