Last active
February 21, 2019 16:50
-
-
Save trnktms/7d5a8c164cf9e9d3d357d42da14c106f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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