Few weeks ago I described how to extend Tools menu with additional Move to trash command. Trash button was displayed only for News pages. For all other page types button was not displayed. What if we need to show the button also on the Article type? We could add another hardcoded Page Type condition to dojo component. It will work but it sounds like a fragile solution. It would be better to store all supported types on the server and send serialized settings to the client module.
server available types

To prepare server configuration we need to set backend type in modile.config file. Type is the attribute of “module” node. It should be full type name with assembly (AlloyTest.TrashButtonModule, AlloyTest).

TrashModuleButton have to extend EPiServer.Shell.Modules.ShellModule class. To return custom configuration from module we need to override CreateViewModel method and return custom viewmodel instance.

TrashButtonViewModel have to inherit from ModuleViewModel. It contains one custom setting property AllowedTrashButtonTypes. The list is used to store all content types for which additional trash button should be visible. Serialized parameters are passed directly to system client Bootstrapper and then to the to module constructors.

The allowedAdditionalTrashButtonTypes setting is assigned to the private field and then used in CommandsProvider.

In the command provider allowedAdditionalTrashButtonTypes setting is used to control isAvailable property of Move to Trash command. The command is displayed only if type is listed in the property.