Skip to content

Instantly share code, notes, and snippets.

@MerrittMelker
MerrittMelker / ProductionEventManager.cs
Created August 24, 2015 20:32
example of fluent api for publishing and unpublishing page
using System.Collections.Generic;
using System.Linq;
using Ks.Sf.Modules.Dynamic;
using Telerik.Sitefinity;
using Telerik.Sitefinity.Data.Events;
using Telerik.Sitefinity.DynamicModules;
using Telerik.Sitefinity.DynamicModules.Events;
using Telerik.Sitefinity.DynamicModules.Model;
using Telerik.Sitefinity.GenericContent.Model;
using Telerik.Sitefinity.Model;
@MerrittMelker
MerrittMelker / bar.cs
Last active October 8, 2015 03:34
superpus potential example
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Tribune
{
public abstract class Tribune
@MerrittMelker
MerrittMelker / Hackish Way To Make ItemViewModel Work with RelatedItems
Last active July 23, 2016 09:16
Example Hooking Up Related Items To List of Dynamic Content to Create Functional ItemViewModels
private List<ItemViewModel> GetSponsorViewModels()
{
var sponsorGuids = JsonSerializer.DeserializeFromString<IList<Guid>>(SelectedSponsorIds);
var type = TypeResolutionService.ResolveType(SponsorType);
var sponsorDataItems = DynamicModuleManager.GetManager().GetDataItems(type).Where(x => x.Status == ContentLifecycleStatus.Live && x.Visible && sponsorGuids.Contains(x.Id));
var sponsorViewModels = new List<ItemViewModel>();
foreach (var spi in sponsorDataItems)
{
spi.GetRelatedItems<Image>("Image");
sponsorViewModels.Add(new ItemViewModel(spi));
@MerrittMelker
MerrittMelker / sample 1
Created September 8, 2016 01:08
editing umbraco content from database
/****** Script for SelectTopNRows command from SSMS ******/
begin tran
declare @start bigint, @end bigint
--STUFF ([xml],
SELECT
@start = PATINDEX('%calendarLink"%', [xml]),
@end = PATINDEX('%}%', Substring([xml], PATINDEX('%calendarLink%', [xml]), datalength([xml])))
FROM [cmsContentXml] where nodeId = 1098
select substring([xml], @start + 14, @end) from cmsContentXml where nodeid = 1098