createElementMenuButtonWidget

How to get createElementMenuButtonWidget

import createElementMenuButtonWidget from 'fontoxml-families/src/createElementMenuButtonWidget.js'

Type: Function

This widget is used to display an element menu button.

Clicking the button opens a menu with the ContextualOperations configured for the node on which the widget is used. Contextual operations for which the hideIn property is set to "element-menu" are not shown.

This widget is best used in the blockOutsideAfter widget area.

Example

Configure a few contextual operations for a quote element and add the element menu button:

import createElementMenuButtonWidget from 'fontoxml-families/src/createElementMenuButtonWidget.js';

configureProperties(sxModule, 'self::quote', {
    contextualOperations: [
        { name: 'quote-attribution-insert' },
        { name: 'quote-unwrap' },
        // The next operation is not shown in the element menu, but will be shown in other places
        // such as the breadcrumbs and context menu
        { name: 'quote-edit-properties', hideIn: ['element-menu'] }
    ],
    blockOutsideAfter: [createElementMenuButtonWidget()]
});

Returns

Type: Widget

Was this page helpful?