Skip to content

Instantly share code, notes, and snippets.

@frueda1
frueda1 / Program.cs
Created June 1, 2024 03:54
Webhook HTTP Request
using Serilog;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Information()
.Enrich.FromLogContext()
.Enrich.WithProcessId()
.Enrich.WithProcessName()
@frueda1
frueda1 / DevTips.tsx
Created October 30, 2023 15:48
Basic code to execute GraphQL queries in XM Cloud NextJs
import {
GetStaticComponentProps,
Image,
ImageField,
Text,
TextField,
useComponentProps,
} from '@sitecore-jss/sitecore-jss-nextjs';
import { ComponentProps } from 'lib/component-props';
import { GraphQLQueryResult } from 'lib/graphql-queries/GraphQLQuery';
@frueda1
frueda1 / Layout.tsx
Created September 17, 2023 04:54
XM Cloud integration with Sitecore Personalize, and call GraphQL query with Decision Model Result as parameter.
/**
* This Layout is needed for Starter Kit.
*/
import React from 'react';
import Head from 'next/head';
import {
Placeholder,
getPublicUrl,
LayoutServiceData,
@frueda1
frueda1 / Experience.cs
Last active June 10, 2023 03:06
Personalize class to call Sitecore Personalize API
public class Experience
{
[JsonProperty("clientKey", NullValueHandling = NullValueHandling.Ignore)]
public string ClientKey { get; set; }
[JsonProperty("channel", NullValueHandling = NullValueHandling.Ignore)]
public string Channel {get; set;}
[JsonProperty("language", NullValueHandling = NullValueHandling.Ignore)]
public string Language {get; set;}
[JsonProperty("currencyCode", NullValueHandling = NullValueHandling.Ignore)]
public string CurrencyCode {get; set;}
@frueda1
frueda1 / KeyValueWithDropdownOrdered.cs
Created April 11, 2023 10:05
Keylookup Extend to add new column
using Sitecore.Data.Items;
using Sitecore.Diagnostics;
using Sitecore.Shell.Applications.ContentEditor;
using Sitecore.Text;
using Sitecore.Web.UI.Sheer;
using System;
using System.Collections.Specialized;
using System.IO;
using System.Web;
using System.Web.UI;