Skip to content

Commit

Permalink
Added logic in order to skip the non-SXA sites
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-chunikhin committed Jul 23, 2021
1 parent 6e9f2c6 commit 4b18af4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/" xmlns:role="http://www.sitecore.net/xmlconfig/role/">
<sitecore role:require="Standalone OR ContentManagement OR ContentDelivery OR Processing OR Reporting">
<pipelines>
<httpRequestProcessed>
<processor type="Sitecore.XA.Foundation.Multisite.Pipelines.HttpRequest.StoreSiteNameInCookie, Sitecore.XA.Foundation.Multisite"
resolve="true" >
<patch:attribute name="type">Sitecore.Support.XA.Foundation.Multisite.Pipelines.HttpRequest, Sitecore.Support.489284</patch:attribute>
</processor>
</httpRequestProcessed>
</pipelines>
</sitecore>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
using Sitecore.DependencyInjection;
using Sitecore.Pipelines.HttpRequest;
using Sitecore.XA.Foundation.Abstractions;
using Sitecore.XA.Foundation.Multisite;
using Sitecore.XA.Foundation.Multisite.Extensions;

namespace Sitecore.XA.Foundation.Multisite.Pipelines.HttpRequest
namespace Sitecore.Support.XA.Foundation.Multisite.Pipelines.HttpRequest
{
public class StoreSiteNameInCookie : HttpRequestProcessor
{
Expand All @@ -17,6 +18,10 @@ public override void Process(HttpRequestArgs args)
{
return;
}
if (!ServiceLocator.ServiceProvider.GetService<IContext>().Site.IsSxaSite())
{
return;
}
if (Context.Site != null && Context.Site.Name != "shell" && Context.Item != null)
{
var siteInfo = ServiceLocator.ServiceProvider.GetService<ISiteInfoResolver>().GetSiteInfo(Context.Item);
Expand Down

0 comments on commit 4b18af4

Please sign in to comment.