Skip to content

Instantly share code, notes, and snippets.

View jstemerdink's full-sized avatar

Jeroen jstemerdink

View GitHub Profile
public List<PromotionalBanner> GetAllPromotionalBannersForMarket()
{
List<PromotionalBanner> promotionBanners = new List<PromotionalBanner>();
try
@jstemerdink
jstemerdink / ScheduledNotificationTest.cs
Last active February 28, 2023 10:54
Using the new EPiServer notification API
using System.Collections.Generic;
using System.Linq;
using System.Web.Security;
using EPiServer.ContentCollaboration.Notification;
using EPiServer.Notification;
using EPiServer.PlugIn;
using EPiServer.Scheduler;
using EPiServer.ServiceLocation;
public void SendCartToQueue()
{
if (this._iMessagingService.MessagingEnabled && this._iMessagingService.SendMessage(this.CartHelper.Cart))
{
return;
}
this.CartHelper.Cart.SaveAsPurchaseOrder();
}
using System;
using System.Web.Mvc;
using EPiServer.Shell.ObjectEditing;
using Mediachase.BusinessFoundation.Data.Meta.Management;
/// <summary>
/// The meta enum selection attribute.
/// </summary>
protected void Session_Start(object sender, EventArgs e)
{
this.UpdateViewedPagesSession();
this.UpdateViewedCategoriesSession();
}
protected void UpdateViewedPagesSession()
{
HttpCookie myCookie = null;
@jstemerdink
jstemerdink / Example.txt
Last active September 29, 2016 13:20
Use an attribute to create facets for an EPiServer Find query
[Facet(1, FacetType.TermsFacetFor)]
public virtual string TermsFacetExample { get; set; }
IClient searchManager = Client.CreateFromConfig();
ITypeSearch<StandardPage> queryTest = searchManager.Search<StandardPage>().For("test");
queryTest = queryTest.AddFacets();
IContentResult<StandardPage> results = queryTest.GetContentResult();