Skip to content

Instantly share code, notes, and snippets.

Avatar

Gabe Sumner gabesumner

  • Salesforce
  • San Francisco, CA
View GitHub Profile
@gabesumner
gabesumner / CustomWidget.ascx
Created Dec 29, 2010
Exploring blog posts using Sitefinity's Fluent API
View CustomWidget.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CustomWidget.ascx.cs" Inherits="SitefinityWebApp.Custom.CustomWidget" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<div class="customwidget">
<div><asp:Button ID="CreateBlog" runat="server" Text="Create Blog"
onclick="CreateBlog_Click" /></div>
<div><asp:Button ID="CreatePosts" runat="server" Text="Create Posts"
onclick="CreatePosts_Click" /></div>
@gabesumner
gabesumner / EventListTemplate.ascx
Created Jan 6, 2011
Helper tool for truncating text based on a Length of characters in a Sitefinity Widget Template
View EventListTemplate.ascx
<%@ Control Language="C#" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.ContentUI" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="cc1" Namespace="SitefinityWebApp.Tools" Assembly="SitefinityWebApp" %>
<telerik:RadListView ID="eventsList" ItemPlaceholderID="ItemsContainer" runat="server" EnableEmbeddedSkins="false" EnableEmbeddedBaseStylesheet="false">
<LayoutTemplate>
<ul class="sfeventsList sfeventsListTitleCityDateContent">
<asp:PlaceHolder ID="ItemsContainer" runat="server" />
@gabesumner
gabesumner / gist:788850
Created Jan 20, 2011
This is the code I used to restyle the blog posts in the Education Starter Kit that is found in the Sitefinity SDK
View gist:788850
<%@ Control Language="C#" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.Comments" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.ContentUI" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Import Namespace="Telerik.Sitefinity" %>
<%@ Register TagPrefix="cc1" Namespace="SitefinityWebApp.Tools" Assembly="SitefinityWebApp" %>
<telerik:RadListView ID="Repeater" ItemPlaceholderID="ItemsContainer" runat="server" EnableEmbeddedSkins="false" EnableEmbeddedBaseStylesheet="false">
<LayoutTemplate>
@gabesumner
gabesumner / HelloWorld.ascx
Created Jan 25, 2011
Basic HelloWorld Widget with ControlDesigner for Sitefinity 4.0
View HelloWorld.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="HelloWorld.ascx.cs" Inherits="SitefinityWebApp.Widgets.HelloWorld.HelloWorld" %>
<p>Hello <asp:Literal ID="NameLiteral" runat="server" />, how are you?</p>
@gabesumner
gabesumner / Global.asax
Created Aug 18, 2011
Code to warm-up Sitefinity's Backend during Application Start
View Global.asax
using System;
using Telerik.Sitefinity.Modules.Pages;
using Telerik.Sitefinity.Taxonomies;
using Telerik.Sitefinity.Modules.Blogs;
using Telerik.Sitefinity.Modules.Events;
using Telerik.Sitefinity.Modules.News;
using Telerik.Sitefinity.Modules.Libraries.BlobStorage;
using Telerik.Sitefinity.Modules.Libraries;
using Telerik.Sitefinity.Modules.Forms;
using Telerik.Sitefinity.Modules.Ecommerce.Catalog;
@gabesumner
gabesumner / gist:1195950
Created Sep 5, 2011
Recompile (re-evaluate) the URL associated with all Sitefinity blog posts
View gist:1195950
using System;
using System.Linq;
using Telerik.Sitefinity;
using Telerik.Sitefinity.Modules.Blogs;
using Telerik.Sitefinity.Blogs.Model;
namespace SitefinityWebApp.Extensions
{
public partial class test : System.Web.UI.Page
{
@gabesumner
gabesumner / SharedContent.ascx
Created Sep 23, 2011
SharedContent Widget - Displays Sitefinity Shared Content Blocks based on Title
View SharedContent.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SharedContent.ascx.cs" Inherits="SitefinityWebApp.Extensions.Widgets.SharedContent" %>
<asp:Literal ID="ContentLiteral" runat="server" />
@gabesumner
gabesumner / gist:1243069
Created Sep 26, 2011
SQL for renaming the database schema
View gist:1243069
USE clickonpublish
DECLARE @OldSchema AS varchar(255)
DECLARE @NewSchema AS varchar(255)
SET @OldSchema = 'dbo'
SET @NewSchema = 'clickonpublish'
DECLARE @sql AS varchar(MAX)
@gabesumner
gabesumner / WordPressImport.ascx
Created Feb 10, 2012
Importing WordPress Export files into Sitefinity CMS (VERY unfinished)
View WordPressImport.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WPimport.ascx.cs" Inherits="SitefinityWebApp.Widgets.WPimport" %>
<div>
<div style="color: red;">
<asp:Literal ID="Error" Visible="false" runat="server" />
</div>
<div>
<asp:Label AssociatedControlID="WordPressFile" runat="server">WordPress Export File: </asp:Label>
@gabesumner
gabesumner / DisqusExport.aspx
Created Feb 12, 2012
Import Disqus Comments from Sitefinity 3
View DisqusExport.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Use Ctrl + A to select All, then Paste into Notepad. This is your XML export file.</title>
</head>
<body>
<form id="form1" runat="server">