Skip to content

Instantly share code, notes, and snippets.

@sitefinitySDK
Created March 26, 2024 14:40
Show Gist options
  • Save sitefinitySDK/58a7a3a47090e14ee4842ea43793986c to your computer and use it in GitHub Desktop.
Save sitefinitySDK/58a7a3a47090e14ee4842ea43793986c to your computer and use it in GitHub Desktop.
import { WidgetRegistry, initRegistry, defaultWidgetRegistry } from '@progress/sitefinity-nextjs-sdk';
import { HelloWorld } from './components/hello-world/hello-world';
import { HelloWorldEntity } from './components/hello-world/hello-world.entity';
const customWidgetRegistry: WidgetRegistry = {
widgets: {
'HelloWorld': {
componentType: HelloWorld, // registration of the widget
entity: HelloWorldEntity, // registration of the designer
editorMetadata: {...} // metadata to be displayed in the WYSIWYG editor - title, available operation, empty content visuals etc.
ssr: true // whether this is a server rendered or client rendered component
}
}
};
customWidgetRegistry.widgets = {
...defaultWidgetRegistry.widgets,
...customWidgetRegistry.widgets
};
export const widgetRegistry: WidgetRegistry = initRegistry(customWidgetRegistry);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment