Use the View widget sample to create a custom widget, which can have its default view overridden. The widget utilizes the renderview component that requires the following properties:
renderview
widgetKey
viewName
SfViewName
viewProps
ViewPropsBase<T>
PREREQUISITES: You must set up a Sitefinity renderer application and connect it to your Sitefinity CMS application. For more information, see Install Sitefinity in Next.js mode.
sfViewName
widget-view-default-view.tsx
Then you need to create a file that hosts the React component:
.tsx
widget-views.tsx
Next create an entity file, that would describe the widget designer.
.ts
widget-view-entity.ts
The next step is to register the component implementation and the designer metadata with the Next.js renderer. The Sitefinity Next.js SDK will automatically generate the needed designer metadata based on the defined entity. The registry is used to find the component function reference for the widget from the response of the Page Layout service. It is also used when generating metadata for the widget when it is used in the WYSIWYG page editor – labels, visuals etc.
This sample is available in Sitefinity’s GitHub repository. You can run and play with it. To do this, perform the following:
.env.development
PROXY SETTINGS
SF_CMS_URL
SF_LOCAL_VALIDATION_KEY=
npm run dev
Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.
This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.
This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.
The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important