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 / HelloWorld.ascx
Created Aug 25, 2011
HelloWorld example for Sitefinity 4 custom Widgets and ControlDesigners
View HelloWorld.ascx
<%@ 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 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 / ToolsFile.xml
Created Sep 23, 2011
My favorite customizations for Sitefinity's Rich Text Editor
View ToolsFile.xml
<?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 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)