Skip to content

Instantly share code, notes, and snippets.

var CustomIntegration = window.CustomIntegration || {};
CustomIntegration.cdp = (function ($, document) {
var clientDataLayer = {
"currencyCode": "AUD"
};
startTrackingForms = function () {
var inputs = $("form[data-sc-fxb]").find("input:not([type='submit']), select, textarea");
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/">
<sitecore role:require="Standalone or ContentManagement or ContentDelivery">
<pipelines>
<forms.renderForm>
<processor type="Feature.Forms.Pipelines.InitializeAjaxOptions, Feature.Forms" resolve="true"
patch:instead="processor[@type='Sitecore.ExperienceForms.Mvc.Pipelines.RenderForm.InitializeAjaxOptions, Sitecore.ExperienceForms.Mvc']" />
</forms.renderForm>
</pipelines>
</sitecore>
@markgibbons25
markgibbons25 / RouteLinkedRichText.js
Created November 16, 2021 08:16
VueJS - RouteLinkedRichText.js
export const RouteLinkedRichText = {
props: {
field: { type: Object, required: true },
tag: { type: String, default: 'div' },
editable: { type: Boolean, default: true },
},
render(createElement) {
if (!this.$props.field || (!this.$props.field.editable && !this.$props.field.value)) {
return null;
}
using System;
using System.Collections.Generic;
using GraphQL;
using GraphQL.Types;
using Sitecore;
using Sitecore.Data;
using Sitecore.Data.Items;
using Sitecore.Diagnostics;
using Sitecore.Globalization;
using Sitecore.Services.GraphQL.Content;
using System;
using System.Collections.Generic;
using System.Linq;
using Sitecore.Abstractions;
using Sitecore.Caching;
using Sitecore.Configuration;
using Sitecore.Data;
using Sitecore.Data.Events;
using Sitecore.Data.Items;
using Sitecore.Diagnostics;
@markgibbons25
markgibbons25 / SiteAwareInitializeAjaxOptions.cs
Last active April 30, 2021 01:15
Experience Forms - Getting the Context Site and Item in Submit Actions
public class ContextAwareInitializeAjaxOptions : InitializeAjaxOptions
{
public const string ItemKey = "sc_ctx_item";
private const string siteKey = "sc_site";
public ContextAwareInitializeAjaxOptions(IFormRenderingContext formRenderingContext)
: base(formRenderingContext)
{
}
public class RegisterDependencies : Sitecore.DependencyInjection.BaseServiceProviderBuilder
{
protected override IServiceProvider BuildServiceProvider(IServiceCollection serviceCollection)
{
// FIX FOR https://github.com/aspnet/AspNetCore/issues/2737
var options = new ServiceProviderOptions();
var type = options.GetType();
var propertyInfo = type.GetProperty("Mode", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
propertyInfo.SetValue(options, 1); // SET TO RUNTIME
function Write-LogExtended {
param(
[string]$Message,
[System.ConsoleColor]$ForegroundColor = $host.UI.RawUI.ForegroundColor,
[System.ConsoleColor]$BackgroundColor = $host.UI.RawUI.BackgroundColor
)
Write-Log -Object $message
Write-Host -Object $message -ForegroundColor $ForegroundColor -BackgroundColor $backgroundColor
}
using System;
using System.Linq;
using System.Runtime.CompilerServices;
using Sitecore.XConnect;
using Sitecore.XConnect.Client.Configuration;
using Sitecore.XConnect.Operations;
namespace Yours
{
public interface IXdbRequestPerformer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.UI.WebControls;
using Sitecore.Modules.EmailCampaign.Application.EmailDispatch;
namespace Foundation.xDB.sitecore.admin
{
public partial class ExmMessageActivator : System.Web.UI.Page
{