Skip to content

Instantly share code, notes, and snippets.

@trnktms
Last active February 21, 2019 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trnktms/7d5a8c164cf9e9d3d357d42da14c106f to your computer and use it in GitHub Desktop.
Save trnktms/7d5a8c164cf9e9d3d357d42da14c106f to your computer and use it in GitHub Desktop.
namespace Helix.Skeleton.Feature.CustomLayoutResolver.Processors
{
using Helix.Skeleton.Feature.CustomLayoutResolver.Constants;
using Sitecore.Data.Items;
using Sitecore.Pipelines.HttpRequest;
public class CustomLayoutResolver : Sitecore.Pipelines.HttpRequest.LayoutResolver
{
public override void Process(HttpRequestArgs args)
{
// CustomLayoutSettings.LayoutItemId is the ID of the new layout item in Sitecore
LayoutItem layoutItem = Sitecore.Context.Database.GetItem(CustomLayoutSettings.LayoutItemId);
Sitecore.Context.Page.FilePath = layoutItem.FilePath;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment