Skip to content

Instantly share code, notes, and snippets.

Avatar

Luc Gosso LucGosso

View GitHub Profile
@LucGosso
LucGosso / FeatureFlagService.cs
Last active Aug 30, 2020
Simple Feature Flag Service - blob post https://devblog.gosso.se/?p=1410
View FeatureFlagService.cs
using AlloyTemplates.Business;
using EPiServer;
using EPiServer.Core;
using EPiServer.Personalization.VisitorGroups;
using EPiServer.ServiceLocation;
using EPiServer.Web;
using System;
using System.Configuration;
using System.Reflection;
using System.Web;
@LucGosso
LucGosso / module.config
Last active Feb 6, 2020
Link to containing parent for media and blocks when not used. Blogg post: https://devblog.gosso.se/?p=1291
View module.config
<?xml version="1.0" encoding="utf-8"?>
<module>
<!--clientResources>
<add name="epi-cms.widgets.base" path="Styles/Styles.css" resourceType="Style"/>
</clientResources-->
<dojo>
<!-- Add a mapping from site to ~/ClientResources/Scripts to the dojo loader configuration -->
<paths>
<add name="clientscripts" path="Scripts" />
</paths>
@LucGosso
LucGosso / tracking.js
Last active Oct 16, 2019
Google analytics Gist tracking mailto, download, external links and Episerver Form. https://devblog.gosso.se/?p=1232
View tracking.js
function epiGat(settings) {
if (settings.downloads || settings.external || settings.mailto) {
var isinternal = new RegExp('^' + window.location.protocol + '\/\/' + window.location.host, 'i');
function addEvent(obj, type, fn) {
if (obj.addEventListener)
obj.addEventListener(type, fn, false);
else if (obj.attachEvent) {
obj['e' + type + fn] = fn;
obj[type + fn] = function () { obj['e' + type + fn](window.event); }
@LucGosso
LucGosso / FotoWare.PlugIns.Episerver.nuspec
Created Jun 5, 2019
Use build tasks and nuspec to build Episerver addon in visual studio ( https://devblog.gosso.se/?p=1148 )
View FotoWare.PlugIns.Episerver.nuspec
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>FotoWare.PlugIns.Episerver</id>
<version>$version$</version>
<title>Episerver Addon integrates Fotoware DAM with Episerver CMS and Commerce</title>
<authors>FotoWare</authors>
<owners>FotoWare</owners>
<iconUrl>https://www.fotoware.com/hubfs/FotoWare_January2018/image/favicon.ico</iconUrl>
<projectUrl>https://learn.fotoware.com/02_FotoWeb_8.0/Integrating_FotoWeb_with_third-party_systems/Episerver_plugin_documentation</projectUrl>
@LucGosso
LucGosso / PageNotUpdatedReportController.cs
Last active Nov 21, 2018
ILM: Episerver Report to monitor pages not updated for a while [https://devblog.gosso.se/?p=961]
View PageNotUpdatedReportController.cs
using EPiServer;
using EPiServer.Core;
using EPiServer.Security;
using EPiServer.Web.Routing;
using Gosso.Mvc.Business.Initialization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
@LucGosso
LucGosso / ILMPageCheckJob.cs
Last active Nov 21, 2018
ILM: Scheduled job and server to get all pages that is not updated from a past date [https://devblog.gosso.se/?p=953]
View ILMPageCheckJob.cs
using EPiServer;
using EPiServer.Core;
using EPiServer.PlugIn;
using EPiServer.Security;
using EPiServer.ServiceLocation;
using EPiServer.Web;
using EPiServer.Web.Routing;
using Gosso.Mvc.Business.Initialization;
using Gosso.Mvc.Helpers;
using log4net;
View CustomXhtmlStringEditorDescriptor.cs
using EPiServer.Core;
using EPiServer.Shell.ObjectEditing.EditorDescriptors;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Gosso.Episerver.Business.EditorDescriptors
{
View editor_plugin_img.js
"use strict";
var tinymce = tinymce || {};
//Register the plugin
tinymce.PluginManager.add('customimagebuttonplugin', function (editor, url) {
//your custom logic when button clicked
editor.addCommand('tinymcecustombutton', function () {
var isUpdate = false;
//default values
@LucGosso
LucGosso / GetPopularItemsFromAnalyticsJob.cs
Last active Jun 30, 2018
Google Analytics Service v4 C# .netframework example with Episerver. Blogpost https://devblog.gosso.se/?p=766
View GetPopularItemsFromAnalyticsJob.cs
using Gosso.Web.Business.Services;
using EPiServer.DataAbstraction;
using EPiServer.PlugIn;
using EPiServer.Scheduler;
using EPiServer.ServiceLocation;
//Episerver Schedual job to update the cache with fresh data from Google Analytics
namespace Gosso.Web.Business.Jobs
{
[ScheduledPlugIn(DisplayName = "Get Statistics from Analytics (api v4)",
@LucGosso
LucGosso / GoogleAnalyticsService.v3.cs
Last active Jun 18, 2018
Google Analytics Service v3 C# .netframework examples with Episerver
View GoogleAnalyticsService.v3.cs
using EPiServer.Core;
using EPiServer.Framework.Cache;
using EPiServer.ServiceLocation;
using Google.Apis.Analytics.v3;
using Google.Apis.Analytics.v3.Data;
using Google.Apis.Auth.OAuth2;
using Google.Apis.Services;
using System;
using System.Collections.Generic;
using System.Configuration;
You can’t perform that action at this time.