Last active
February 23, 2019 06:23
-
-
Save trnktms/0d780a1a9686e191c5d76379e127f390 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.Mvc.Pipelines.Response.BuildPageDefinition; | |
using System.Collections.Generic; | |
using System.Xml.Linq; | |
public class CustomProcessXmlBasedLayoutDefinition : Sitecore.Mvc.Pipelines.Response.BuildPageDefinition.ProcessXmlBasedLayoutDefinition | |
{ | |
protected override IEnumerable<Sitecore.Mvc.Presentation.Rendering> GetRenderings(XElement layoutDefinition, BuildPageDefinitionArgs args) | |
{ | |
foreach (XElement deviceNode in layoutDefinition.Elements("d")) | |
{ | |
// change the layout ID to the new layout item ID | |
deviceNode.SetAttributeValue("l", CustomLayoutSettings.LayoutItemId); | |
} | |
return base.GetRenderings(layoutDefinition, args); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment