Sample: Next.js script widget
Overview
The Script widget allows you to embed JavaScript code or external script files on your pages. You can also use it to paste embed codes from third-party tools, such as Google Analytics, social media widgets, or other tracking solutions.
You can choose from the following options:
- Inline
In this mode the Script widget renders the content of the text area in the widget designer on the place where the widget is dropped in the WYSIWYG editor - BodyTop
These modes register scripts with the script injection system. TheScriptInjectorcomponents subsequently retrieve these scripts and position them at the beginning of the<body>tag. - BodyBottomThese modes register scripts with the script injection system. The
ScriptInjectorcomponents subsequently retrieve these scripts and position them at the end of the<body>tag.
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.
Required setup
Two critical configurations are needed:
- Include
ScriptInjectorcomponents in the page template - AddScriptInjectorBodyTopand