Skip to content

Instantly share code, notes, and snippets.

View gabesumner's full-sized avatar

Gabe Sumner gabesumner

  • Salesforce
  • San Francisco, CA
View GitHub Profile
@gabesumner
gabesumner / CustomWidget.ascx
Created December 29, 2010 20:28
Exploring blog posts using Sitefinity's Fluent API
<%@ 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 January 6, 2011 00:00
Helper tool for truncating text based on a Length of characters in a Sitefinity Widget Template
<%@ 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 January 20, 2011 22:44
This is the code I used to restyle the blog posts in the Education Starter Kit that is found in the Sitefinity SDK
<%@ 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 January 25, 2011 16:37
Basic HelloWorld Widget with ControlDesigner for Sitefinity 4.0
<%@ 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 August 18, 2011 15:30
Code to warm-up Sitefinity's Backend during Application Start
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 / HelloWorld.ascx
Created August 25, 2011 22:56
HelloWorld example for Sitefinity 4 custom Widgets and ControlDesigners
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="HelloWorld.ascx.cs" Inherits="SitefinityWebApp.Widgets.HelloWorld" %>
<p>Hello <asp:Literal ID="NameLiteral" runat="server" /></p>
@gabesumner
gabesumner / gist:1195950
Created September 5, 2011 21:23
Recompile (re-evaluate) the URL associated with all Sitefinity blog posts
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 / ToolsFile.xml
Created September 23, 2011 15:37
My favorite customizations for Sitefinity's Rich Text Editor
<?xml version="1.0" encoding="utf-8" ?>
<root>
<modules>
<module name="RadEditorStatistics" dockingZone="Bottom" visible="false" />
<module name="RadEditorDomInspector" visible="false" />
<module name="RadEditorNodeInspector" visible="false" />
<module name="RadEditorHtmlInspector" visible="false" />
</modules>
<tools name="MainToolbar">
<tool name="ToggleAdvancedToolbars"/>
@gabesumner
gabesumner / SharedContent.ascx
Created September 23, 2011 21:20
SharedContent Widget - Displays Sitefinity Shared Content Blocks based on Title
<%@ 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 September 26, 2011 19:05
SQL for renaming the database schema
USE clickonpublish
DECLARE @OldSchema AS varchar(255)
DECLARE @NewSchema AS varchar(255)
SET @OldSchema = 'dbo'
SET @NewSchema = 'clickonpublish'
DECLARE @sql AS varchar(MAX)