Skip to content

Instantly share code, notes, and snippets.

View sitefinitySDK's full-sized avatar

Sitefinity SDK sitefinitySDK

View GitHub Profile
var decClient = new sfDataIntell.Client({
apiKey: '12345678-1234-1234-1234-1234567890AB', // Your Data center API key
source: 'website',
cookieMaxAgeInDays: 90, // Set this value in days
cookieSlidingExpiration: true,
useSecureCookies : false
});
var decClient = new sfDataIntell.Client({
apiKey: '12345678-1234-1234-1234-1234567890AB', // Your Data center API key
source: 'website',
cookieMaxAgeInDays: 90, // Set this value in days
cookieSlidingExpiration: true
});
import { RestClient, RestSdkTypes } from '@progress/sitefinity-nextjs-sdk/rest-sdk';
const newsItem = await RestClient.getItem({
type: RestSdkTypes.News,
id: itemId,
provider: itemProvider
});
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.
import { WidgetEntity } from '@progress/sitefinity-widget-designers-sdk';
@WidgetEntity('HelloWorld', 'Hello world')
export class HelloWorldEntity {
Content: string | null = null;
}
import React from 'react';
import { WidgetContext, htmlAttributes } from '@progress/sitefinity-nextjs-sdk';
import { HelloWorldEntity } from './hello-world.entity';
export function HelloWorld(props: WidgetContext<HelloWorldEntity>) {
// attributes are needed for the widget to be visible in edit mode
const dataAttributes = htmlAttributes(props);
return (
<h1 {...dataAttributes}>{props.model.Properties.Content}</h1>
import { WidgetRegistry, initRegistry, defaultWidgetRegistry } from '@progress/sitefinity-nextjs-sdk';
const contentBlockRegistration = DefaultWidgetRegistry.widgets[‘SitefinityContentBlock’];
contentBlockRegistration.editorMetadata.Title = ‘Modified Content block’
import { WidgetRegistry, initRegistry, defaultWidgetRegistry, CSRFormComponents } from '@progress/sitefinity-nextjs-sdk';
const customWidgetRegistry: WidgetRegistry = {
widgets: {
...
}
};
customWidgetRegistry.widgets = {
...defaultWidgetRegistry.widgets,
<?xml version="1.0" encoding="utf-8"?>
<authenticationConfig xmlns:config="urn:telerik:sitefinity:configuration" xmlns:type="urn:telerik:sitefinity:configuration:type" config:version="15.0.8200.0" enableLogging="True">
</authenticationConfig>
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Progress.Sitefinity.AspNetCore;
using Progress.Sitefinity.AspNetCore.FormWidgets;
using Progress.Sitefinity.AspNetCore.Web.Security;
using html_sanitizer;