Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.