Skip to content

Instantly share code, notes, and snippets.

@sohelsd
sohelsd / VersionButton.cs
Last active August 29, 2015 14:13
Sitecore Unversioned to Versioned media items
using Sitecore.Data;
using Sitecore.Data.Items;
using Sitecore.Shell.Framework.Commands;
namespace MySite.Website.Utilities
{
public class VersionButton: Command
{
Sitecore.Data.Database Master = Sitecore.Configuration.Factory.GetDatabase("master");
@sohelsd
sohelsd / Export.ashx
Last active January 11, 2016 23:44
Sitecore Export Content Tree to Excel
<%@ WebHandler Language="C#" CodeBehind="ExportHandler.ashx.cs" Class="HugeIncSitecore.Utilities.ExportHandler" %>
@sohelsd
sohelsd / UIActivity WhatsApp
Last active January 21, 2023 23:13
WhatsApp Swift UIActivityViewController Custom UIActivity
How to add WhatsApp to UIActivityViewController?
Drop the Whatsapp.swift file in your project.
Initialize the controller as described in ViewController.swift
@sohelsd
sohelsd / RelativeDatasource.cs
Last active August 29, 2015 14:25
Sitecore automatic datasource builder. To use it, Drop the config file into App_Config/Includes folder. Use ./Components as your sublayout/rendering Datasource.
using Sitecore.Data;
using Sitecore.Data.Items;
using Sitecore.Data.Managers;
using Sitecore.Pipelines.GetRenderingDatasource;
using Sitecore.SecurityModel;
using Sitecore.Sites;
using Sitecore.Text;
using System;
using System.Collections.Generic;
using System.Linq;
@sohelsd
sohelsd / Global.asax.cs
Created July 27, 2015 19:22
Sitecore Package Installer through code. You store packages under /Packages folder. Call the controller through /utility/installpackage.
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace Site.Web
{
public class MvcApplication : HttpApplication
{
protected void Application_Start()
{
@sohelsd
sohelsd / Global.asax.cs
Created July 27, 2015 19:48
Sitecore Programmatically publish content.
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace Site.Web
{
public class MvcApplication : HttpApplication
{
protected void Application_Start()
{