Skip to content

Instantly share code, notes, and snippets.

View MattisOlsson's full-sized avatar

Mattias Olsson MattisOlsson

View GitHub Profile
@MattisOlsson
MattisOlsson / Global.asax.cs
Last active August 29, 2015 14:21
Commerce routing fix
public class Global : EPiServer.Global
{
protected override void RegisterRoutes(RouteCollection routes)
{
base.RegisterRoutes(routes);
RouteConfig.RegisterRoutes(RouteTable.Routes);
}
}
@MattisOlsson
MattisOlsson / IPagedEnumerable.cs
Last active August 29, 2015 14:23
Paging code
using System.Collections.Generic;
namespace EPiServer.Templates.Alloy.Collections
{
public interface IPagedEnumerable<out T> : IEnumerable<T>, IPaging
{
}
}
@MattisOlsson
MattisOlsson / ImageCollection.js
Last active August 29, 2015 14:24
Dojo widget
define([
"dojo/_base/array",
"dojo/_base/declare",
"dojo/_base/lang",
"dojo/dom",
"dojo/dom-construct",
"dojo/dom-class",
"dojo/when",
"dojo/on",
"dojo/topic",
@MattisOlsson
MattisOlsson / EmployeeContentProvider.cs
Last active March 3, 2016 13:15
EmployeeContentProvider
public class EmployeesContentProvider : ContentProvider
{
private readonly NameValueCollection _parameters = new NameValueCollection(2);
protected readonly string OrganizationId;
protected readonly IEmployeeService EmployeeService;
protected readonly IdentityMappingService IdentityMappingService;
public EmployeesContentProvider(string organizationId, ContentReference entryRoot, IEmployeeService employeeService, IdentityMappingService identityMappingService)
{
Förslag på åtgärder på startsida:
- Ny blokkflate under Hero (som vi kan sätta en egen CSS-klass på wrappern för och göra eventuella anpassningar per sajt).
- Lägga till checkbox på "Instillinger"-fanen på samtliga block, "Sentrert". Kryssar man i den så läggs CSS-klass "block-center" till på block-wrappern.
- Undvika "row-closer row-reflow" på row-wrapper i ny blokkflate direkt under Hero. Skapa hellre override styles baserat på CSS-klass som vi kan sätta på wrappern (.container).
System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
at System.IO.PathHelper.GetFullPathName()
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.GetFullPathInternal(String path)
at System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath)
at System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath)
at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String path)
at System.Web.InternalSecurityPermissions.PathDiscovery(String path)
at
{
"id": 1047,
"newsletterId": 2,
"fromEmail": "post@abelia.no",
"fromName": "Abelia Nyhetsbrev",
"subject": "Nyheter fra Abelia",
"created": "2016-06-16T15:38:00",
"saved": "2016-06-16T15:38:00",
"sendDate": "2016-06-16T15:29:00",
"createdBy": "mattias",
using System;
using System.Linq;
using EPiServer.ServiceLocation;
using Geta.EPi.Checkout.Core.Infrastructure.Exceptions;
using Mediachase.Commerce.Orders;
using Mediachase.Commerce.Website;
using Mediachase.Commerce.Website.Helpers;
namespace Geta.EPi.Checkout.Core.Services
{
[ServiceConfiguration(typeof(ContentAreaRenderer), Lifecycle = ServiceInstanceScope.Singleton)]
public class ContainerAndRowContentAreaRenderer : ContentAreaRenderer
{
// Number of columns in site grid
protected const int NumberOfGridColumns = 12;
// TagBuilder for the current container div.
protected TagBuilder CurrentContainer;
// TagBuilder for the current row div.
@MattisOlsson
MattisOlsson / FacetExtensions.cs
Created September 30, 2016 08:25
Categories facet
public static class FacetExtensions
{
public static ITypeSearch<T> ContentCategoriesFacet<T>(this ITypeSearch<T> request) where T : ICategorizable
{
return request.HistogramFacetFor(x => x.Category, 1);
}
public static ITypeSearch<T> CategoriesFacet<T>(this ITypeSearch<T> request, Expression<Func<T, object>> fieldExpression) where T : ICategorizable
{
return request.HistogramFacetFor(fieldExpression, 1);