Skip to content

Instantly share code, notes, and snippets.

@herskinduk
Last active August 29, 2015 14:07
Show Gist options
  • Save herskinduk/00645f77713dc2be0f0b to your computer and use it in GitHub Desktop.
Save herskinduk/00645f77713dc2be0f0b to your computer and use it in GitHub Desktop.
Resolve Active Commerce and SBOS accelerators Sublayout conflict
using ActiveCommerce.Extensions;
namespace SbosAcceleratorsPlusActiveCommerce
{
public class SkinnedSublayout : global::Sitecore.SbosAccelerators.Shared.Web.UI.WebControls.Sublayout
{
protected override void CreateChildControls()
{
if (global::Sitecore.Context.Site != null)
{
base.Path = global::Sitecore.Context.Site.ResolveSkinPath(base.Path);
}
base.CreateChildControls();
}
}
}
using Sitecore.Reflection;
using Sitecore.SbosAccelerators.Shared.Web.UI;
using System.Collections.Specialized;
using System.Web.UI;
namespace SbosAcceleratorsPlusActiveCommerce
{
public class SkinnedSublayoutRenderingType : SublayoutRenderingType
{
public override Control GetControl(NameValueCollection parameters, bool assert)
{
var sublayout = new SkinnedSublayout();
foreach (string str in parameters.Keys)
{
string str2 = parameters[str];
ReflectionUtil.SetProperty(sublayout, str, str2);
}
return sublayout;
}
}
}
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
<sitecore>
<renderingControls>
<control template="sublayout">
<patch:delete />
</control>
<control template="sublayout">
<patch:delete />
</control>
<control template="skinned sublayout">
<patch:delete />
</control>
<control template="sublayout" type="SbosAcceleratorsPlusActiveCommerce.SkinnedSublayoutRenderingType, SbosAcceleratorsPlusActiveCommerce" propertyMap="Path=path" />
<control template="skinned sublayout" type="SbosAcceleratorsPlusActiveCommerce.SkinnedSublayoutRenderingType, SbosAcceleratorsPlusActiveCommerce" propertyMap="Path=path" />
</renderingControls>
</sitecore>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment