Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Steve McNiven-Scott sitefinitysteve

🏠
Working from home
Block or report user

Report or block sitefinitysteve

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sitefinitysteve
sitefinitysteve / error.md
Last active Jan 27, 2017
Kendo Grid data undefined error
View error.md
Uncaught TypeError: Cannot read property 'data' of undefined
    at init.setup (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl16_TSM&compress=2&_TSM_CombinedScripts_=%3b%3bT…:28)
    at init.create (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl16_TSM&compress=2&_TSM_CombinedScripts_=%3b%3bT…:28)
    at Object.<anonymous> (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl16_TSM&compress=2&_TSM_CombinedScripts_=%3b%3bT…:28)
    at Function.Deferred (ScriptResource.axd?d=OfhH2xFGzDSYc0LaAaaOD08yz4IMU64J5fBMHu0-Lz13cohNhivVQFfhqawUAIMaGh_RVi-P3FmRXW…:2)
    at init._promise (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl16_TSM&compress=2&_TSM_CombinedScripts_=%3b%3bT…:28)
    at init._send (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl16_TSM&compress=2&_TSM_CombinedScripts_=%3b%3bT…:28)
    at init.sync (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl16_TSM&compress=2&_TSM_CombinedScripts_=%3b%3bT…:28)
    at init.saveRow (Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl1
@sitefinitysteve
sitefinitysteve / sf-html-field.sf-cshtml
Created Jan 9, 2017
Sitefinity Kendo Editor definition
View sf-html-field.sf-cshtml
<textarea id="editor" style="height: 340px;"
kendo-editor="editorWidget" ng-model="sfModel"
k-scope-field="editorWidget"
sf-toggle-commands="strikethrough, justifyFull, subscript, superscript, fontName, fontSize, foreColor, backColor, print"
k-encoded="false"
k-stylesheets='[getPackageResourceUrl("/ResourcePackages/Bootstrap/assets/dist/css/styles.min.css")]'
k-paste-cleanup = '{
all: false,
css: true,
@sitefinitysteve
sitefinitysteve / web.config.xml
Last active Nov 4, 2016
Sitefinity Frontend version bindings
View web.config.xml
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="bin" />
<!-- FRONTEND -->
<dependentAssembly><assemblyIdentity name="Telerik.Sitefinity.Frontend" publicKeyToken="b28c218413bdf563" culture="neutral" /><bindingRedirect oldVersion="0.0.0.0-1.7.620.0" newVersion="1.7.620.0" /></dependentAssembly>
<dependentAssembly><assemblyIdentity name="Telerik.Sitefinity.Frontend.Blogs" publicKeyToken="b28c218413bdf563" culture="neutral" /><bindingRedirect oldVersion="0.0.0.0-1.7.620.0" newVersion="1.7.620.0" /></dependentAssembly>
<dependentAssembly><assemblyIdentity name="Telerik.Sitefinity.Frontend.Card" publicKeyToken="b28c218413bdf563" culture="neutral" /><bindingRedirect oldVersion="0.0.0.0-1.7.620.0" newVersion="1.7.620.0" /></dependentAssembly>
<dependentAssembly><assemblyIdentity name="Telerik.Sitefinity.Frontend.Comments" publicKeyToken="b28c218413bdf563" culture="neutral" /><bin
@sitefinitysteve
sitefinitysteve / helpers.less
Created Aug 25, 2016
Margin & Padding LESS Helpers
View helpers.less
.padding-none{
padding: 0 !important;
}
/* Padding 20 */
.padding-10 {
padding: 10px !important;
}
.padding-top-10 {
@sitefinitysteve
sitefinitysteve / sitefinity_mvc_tag.css
Created May 19, 2016
Add the MVC tag to Sitefinity widgets in the page editor
View sitefinity_mvc_tag.css
#sfPageContainer{
div[controltype^="Telerik.Sitefinity.Mvc"] .rdCenter .rdTitleBar > em::after{
content: "MVC";
background-color: #105CB6;
color: #FFF;
font-size: 10px;
padding: 0 4px;
margin-left: 5px;
}
}
@sitefinitysteve
sitefinitysteve / SitefinityServiceStackTemplate.cs
Created Apr 22, 2016
ServiceStack template for sitefinity
View SitefinityServiceStackTemplate.cs
using System;
using System.Collections.Generic;
using System.Linq;
using Telerik.Sitefinity;
using Telerik.Sitefinity.Model;
using Telerik.Sitefinity.DynamicModules;
using Telerik.Sitefinity.Data.Linq.Dynamic;
using Telerik.Sitefinity.Services.Search;
using Telerik.Sitefinity.Utilities.TypeConverters;
using ServiceStack.Text;
@sitefinitysteve
sitefinitysteve / ClearSingleUserLdapCache.cs
Last active Mar 3, 2016
Clear a Sitefinity users Ldap Cache key on login
View ClearSingleUserLdapCache.cs
public static void ClearSingleUserLdapCache(string username)
{
var keysToClear = new List<string>();
try
{
var userManager = UserManager.GetManager("LdapUsers");
var currentUser = userManager.GetUser(username);
var ldapFacade = new LdapFacade();
var mapping = Telerik.Sitefinity.Configuration.Config.Get<SecurityConfig>().LdapConnections.LdapMapping.UserMapping;
@sitefinitysteve
sitefinitysteve / DetectIndexRenderingMVCFeather.cshtml
Created Oct 14, 2015
Detect when your view is being indexed
View DetectIndexRenderingMVCFeather.cshtml
@using Telerik.Sitefinity.Frontend.Mvc.Infrastructure.Controllers;
@if (ViewContext.Controller.GetIndexRenderMode() == Telerik.Sitefinity.Web.UI.IndexRenderModes.Normal)
{
<div>FROM LAYOUT</div>
}
@sitefinitysteve
sitefinitysteve / SimpleViewControlReference
Created Aug 24, 2015
JustCode template to reference a control in a Sitefinity .ascx simpleview template. I usually bind it to "sfv".
View SimpleViewControlReference
protected virtual $2$ $1$
{
get{
return this.Container.GetControl<$2$>("$1$", true);
}
}
@sitefinitysteve
sitefinitysteve / RunWithUserRegion.cs
Created Jun 9, 2015
Responsible for running set of operations with specific user
View RunWithUserRegion.cs
using System;
using System.Linq;
using System.Security.Principal;
using System.Threading;
using System.Web;
using Telerik.Sitefinity.Security;
using Telerik.Sitefinity.Security.Model;
using Telerik.Sitefinity.Services;
namespace Telerik.Sitefinity.TestUtilities.CommonOperations.Permissions.Api
You can’t perform that action at this time.