This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { ScriptInjectorBodyTop, ScriptInjectorBodyBottom } from '../widgets/script/script-injector'; | |
| export function SitefinityTemplate({ widgets, requestContext }: { | |
| widgets: { [key: string]: ReactNode[] }; | |
| requestContext: RequestContext; | |
| }): JSX.Element { | |
| return ( | |
| <> | |
| <ScriptInjectorBodyTop requestContext={requestContext} /> | |
| <header data-sfcontainer="Header"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script> | |
| (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
| (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
| m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
| })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | |
| ga('create', 'UA-XXXXX-Y', 'auto'); | |
| ga('send', 'pageview'); | |
| </script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { WidgetRegistry, initRegistry, defaultWidgetRegistry } from '@progress/sitefinity-nextjs-sdk'; | |
| import { Script } from './widgets/script/script'; | |
| import { ScriptEntity } from './widgets/script/script.entity'; | |
| const customWidgetRegistry: WidgetRegistry = { | |
| widgets: { | |
| 'Script': { | |
| componentType: Script, | |
| entity: ScriptEntity, | |
| ssr: true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const ScriptLocation = { | |
| Inline: 'Inline', | |
| BodyTop: 'BodyTop', | |
| BodyBottom: 'BodyBottom' | |
| } as const; | |
| export type ScriptLocationType = typeof ScriptLocation[keyof typeof ScriptLocation]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Choice, ContentSection, ContentSectionTitles, DataType, DefaultValue, Description, DisplayName, KnownFieldTypes, WidgetEntity } from '@progress/sitefinity-widget-designers-sdk'; | |
| import { ScriptLocation } from './script-location'; | |
| @WidgetEntity('Script', 'Script') | |
| export class ScriptEntity { | |
| @ContentSection(ContentSectionTitles.LabelsAndMessages, 0) | |
| @DisplayName('Script location') | |
| @Description('Select where the script should be placed on the page') | |
| @Choice([ | |
| { Title: 'Inline', Name: ScriptLocation.Inline, Value: ScriptLocation.Inline }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import 'server-only'; | |
| import { WidgetContext, htmlAttributes } from '@progress/sitefinity-nextjs-sdk'; | |
| import { ScriptEntity } from './script.entity'; | |
| import { ScriptLocation } from './script-location'; | |
| export function Script(props: WidgetContext<ScriptEntity>) { | |
| const { model } = props; | |
| const entity = model.Properties; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import { WidgetModel } from '@progress/sitefinity-nextjs-sdk'; | |
| import { RequestContext } from '@progress/sitefinity-nextjs-sdk'; | |
| import { ScriptLocation, ScriptLocationType } from './script-location'; | |
| interface ScriptInjectorProps { | |
| requestContext: RequestContext; | |
| } | |
| // Helper function to flatten nested widget hierarchy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "servers": { | |
| "sitefinity-aspnet-core": { | |
| "url": "https://mcp.sitefinity.cloud/netcore-widgets/", | |
| "headers": { | |
| "x-sitefinity-url": "https://www.example.com/sf/cms/api/v1/default" | |
| } | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "servers": { | |
| "sitefinity-nextjs": { | |
| "url": "https://mcp.sitefinity.cloud/nextjs-widgets/", | |
| "headers": { | |
| "x-sitefinity-url": "https://www.example.com/sf/cms/api/v1/default" | |
| } | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "Commands": { | |
| "Migrate": { | |
| "CmsUrl": "https://yoursitefinityinstance.net", | |
| "Token": "authentication-token", | |
| "PlaceholderMap": { | |
| "Contentplaceholder1": "Body" | |
| }, | |
| "Widgets": { | |
| "Telerik.Sitefinity.Modules.GenericContent.Web.UI.ContentBlock": { |
NewerOlder