Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Steve McNiven-Scott sitefinitysteve

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 / CodeRush ServiceStack File Template
Last active Apr 11, 2019
This is everything you need to register a servicestack service in Sitefinity. Just set your Route, and make sure to register the plugin in App_Start.
View CodeRush ServiceStack File Template
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 / GetIdp.cs
Created Mar 29, 2019
Get the logged in users IDP\IdentityProvider
View GetIdp.cs
public static class Util
{
public static string GetIdentityProvider()
{
var identity = ClaimsManager.GetCurrentIdentity();
var idToken = identity.Claims.FirstOrDefault(c => c.Type == "id_token");
if (idToken != null)
{
var handler = new JwtSecurityTokenHandler();
var jwtToken = handler.ReadToken(idToken.Value) as JwtSecurityToken;
@sitefinitysteve
sitefinitysteve / Index.cshtml
Last active Nov 23, 2018
Sitefinity twitter MVC widget
View Index.cshtml
@model SitefinityWebApp.Mvc.Models.Twitter.TwitterModel
@using Telerik.Sitefinity.Frontend.Mvc.Helpers;
@Html.Script("/Mvc/Views/Twitter/Resources/twitter.js", "bottom")
<div id="twitter-feed" class="sfTweetsList" data-serviceurl="@Model.ServiceUrl">
<div class="sfTweetItem">
<h6>Latest Tweet</h6>
<div class="sfTweetWrp">
@sitefinitysteve
sitefinitysteve / wireUpGADocumentTracking.js
Created Mar 14, 2015
Sitefinity Google Analytics Document\Link Tracking Code
View wireUpGADocumentTracking.js
function wireUpGADocumentTracking() {
if ($("body.sfPageEditor").length == 0) {
var filetypes = /\.(zip|exe|dmg|pdf|doc.*|xls.*|ppt.*|mp3|txt|rar|wma|mov|avi|wmv|flv|wav)$/i;
var baseHref = '';
if (jQuery('base').attr('href') != undefined) baseHref = jQuery('base').attr('href');
var hrefRedirect = '';
jQuery('#content-wrapper').on('click', 'a', function (event) {
var el = jQuery(this);
var track = true;
@sitefinitysteve
sitefinitysteve / Index.cshtml
Last active Apr 13, 2018
Sitefinity Forms Popup window template
View Index.cshtml
@model Telerik.Sitefinity.Frontend.Forms.Mvc.Models.FormViewModel
@using System;
@using System.Linq;
@using System.Collections;
@using Telerik.Sitefinity;
@using Telerik.Sitefinity.UI.MVC;
@using Telerik.Sitefinity.Frontend.Forms.Mvc.Helpers;
@using Telerik.Sitefinity.Frontend.Forms.Mvc.Models;
@using Telerik.Sitefinity.Frontend.Mvc.Helpers;
@sitefinitysteve
sitefinitysteve / SitefinityLayoutSamples.html
Created Jul 1, 2013
Sitefinity Layout Control Samples
View SitefinityLayoutSamples.html
<!-- 2 col sample -->
<div class="sf_cols">
<div class="sf_colsOut sf_2cols_1_50">
<div class="sf_colsIn sf_2cols_1in_50">
</div>
</div>
<div class="sf_colsOut sf_2cols_2_50">
<div class="sf_colsIn sf_2cols_2in_50">
View genesis_public_key
04081e3baff413e9cc17b5c95013d27ded89553ae98c6f033e8fb2e1a72c63960be604fda42b1d83d59f2aa270b7e5b3dfb4a432c01eb9b6e8f4978eec663d608b
View SitefinityAngularDeclarations.cshtml
@model SitefinityWebApp.Mvc.Models.MyModel
@using Telerik.Sitefinity.Frontend.Mvc.Helpers;
@Html.Script(Url.WidgetContent("Mvc/Scripts/Angular/angular.min.js"), "angular")
@Html.Script(Url.WidgetContent("Mvc/Scripts/Angular/angular-sanitize.min.js"), "angular")
@Html.Script("/MVC/Views/MyWidget/Resources/SitefinityAngularBootstrap.js", "bottom")
<div class="my-widget">
<div ng-controller="sessionsController">
{{ message }}
View SitefinityAngularBootstrap.js
$(function () {
//Boostrap each scheduler
$(".my-widget").each(function (index) {
var appName = 'myApp' + index;
var myApp = angular.module(appName, ['ngSanitize', 'kendo.directives']);
myApp.controller("myController", myController);
angular.bootstrap($(this).get(0), [appName]);
});
});
@sitefinitysteve
sitefinitysteve / Startup.cs
Created Nov 21, 2017
Sitefinity OWIN LetsEncrypt
View Startup.cs
using LetsEncrypt.Owin;
using Owin;
using Telerik.Sitefinity.Owin;
namespace SitefinityWebApp
{
public class Startup
{
public void Configuration(IAppBuilder app)
{
You can’t perform that action at this time.