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 { Content, ContentSection, DisplayName } from '@progress/sitefinity-widget-designers-sdk'; | |
import { ContentListEntity } from './content-list/content-list-entity'; | |
import { MixedContentContext } from '../../editor/widget-framework/mixed-content-context'; | |
export class ExtendedContentListEntity extends ContentListEntity { | |
@Content({ | |
Type: 'Telerik.Sitefinity.Lists.Model.ListItem, Telerik.Sitefinity.News.Model.NewsItem, Telerik.Sitefinity.Events.Model.Event', | |
TypeBlacklist: 'Telerik.Sitefinity.DynamicTypes.Model.PressReleases.Pressrelease' | |
}) | |
@DisplayName('') |
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 { WidgetEntity } from '@progress/sitefinity-widget-designers-sdk'; | |
@WidgetEntity('LocalizedHelloWorld', 'Localized hello world') | |
export class LocalizedHelloWorldEntity { | |
Content: string | null = null; | |
} |
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 { ViewPropsBase } from '@progress/sitefinity-nextjs-sdk'; | |
import { WidgetViewEntity } from '../widget-view-entity'; | |
export function CustomViewExample(props: ViewPropsBase<WidgetViewEntity>) { | |
return (<h1>Custom view for the widget view that overrides the default one</h1>); | |
} |
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
if (!hasAuthCookie && !request.nextUrl.pathname.startsWith('/render-lazy')) { | |
const headers = request.headers; | |
headers.set('x-cached-route-processed', 'true'); | |
let url = new URL(request.url); | |
url.pathname = '/cached' + request.nextUrl.pathname; | |
return NextResponse.rewrite(url, { | |
request: { | |
headers: headers |
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 { SitefinityData } from './widgets/sitefinity-data/sitefinity-data'; | |
import { SitefinityDataEntity } from './widgets/sitefinity-data/sitefinity-data.entity'; | |
const customWidgetRegistry: WidgetRegistry = { | |
widgets: { | |
'SitefinityData': { | |
componentType: SitefinityData, // registration of the widget | |
entity: SitefinityDataEntity, // registration of the designer | |
ssr: true, // whether this is a server rendered or client rendered component |
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 { SitefinityDataEntity } from './sitefinity-data.entity'; | |
import { ViewPropsBase } from '@progress/sitefinity-nextjs-sdk/widgets'; | |
import { SdkItem } from '@progress/sitefinity-nextjs-sdk/rest-sdk'; | |
export interface SitefinityDataViewProps<T extends SitefinityDataEntity> extends ViewPropsBase<T> { | |
items: SdkItem[]; | |
} |
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 { WidgetContext, getMinimumWidgetContext, htmlAttributes } from '@progress/sitefinity-nextjs-sdk'; | |
import { RestClient, RestSdkTypes } from '@progress/sitefinity-nextjs-sdk/rest-sdk'; | |
import { RenderView } from '@progress/sitefinity-nextjs-sdk/widgets'; | |
import { SitefinityDataEntity } from './sitefinity-data.entity'; | |
import { SitefinityDataDefaultView } from './sitefinity-data.view'; | |
import { SitefinityDataViewProps } from './sitefinity-data.view-props'; | |
export async function SitefinityData(props: WidgetContext<SitefinityDataEntity>) { |
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 { DefaultValue, DisplayName, ViewSelector, WidgetEntity } from '@progress/sitefinity-widget-designers-sdk'; | |
@WidgetEntity('SitefinityData', 'Sitefinity data') | |
export class SitefinityDataEntity { | |
@DisplayName('Show summary') | |
@DefaultValue(true) | |
ShowSummary?: boolean; | |
@DisplayName('Items count') | |
@DefaultValue(5) |
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 { StaticSection } from './widgets/custom-section/static-section'; | |
import { StaticSectionEntity } from './widgets/custom-section/static-section.entity'; | |
import { ContainerView } from './widgets/custom-section/container.view'; | |
import { ContainerFluidView } from './widgets/custom-section/container-fluid.view'; | |
import { TwoMixedView } from './widgets/custom-section/twoMixed.view'; | |
import { ThreeAutoLayoutView } from './widgets/custom-section/threeAutoLayout.view'; | |
import { Child } from './widgets/child/child'; | |
const customWidgetRegistry: WidgetRegistry = { |
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 { StaticSectionEntity } from './static-section.entity'; | |
import { ViewPropsBase } from '@progress/sitefinity-nextjs-sdk/widgets'; | |
import { RenderWidgetService } from '@progress/sitefinity-nextjs-sdk'; | |
export function TwoMixedView(props: ViewPropsBase<StaticSectionEntity>) { | |
const column = (containerName: string, className: string) => ( | |
<div className={className} data-sfcontainer={containerName}> | |
{props.widgetContext.model.Children.filter(x => x.PlaceHolder === containerName).map(x => { | |
return RenderWidgetService.createComponent(x, props.widgetContext.requestContext); |