There is a pipeline called getVariants
. It's responsible for creating the list of available variants. You would need to rearrange processors there:
<getVariants>
<processor type="Sitecore.XA.Feature.Composites.Pipelines.GetVariants.SwitchPageTemplateId, Sitecore.XA.Feature.Composites" resolve="true"/>
<processor type="Sitecore.XA.Foundation.Variants.Abstractions.Pipelines.GetVariants.GetSystemVariants, Sitecore.XA.Foundation.Variants.Abstractions" resolve="true"/>
<processor type="Sitecore.XA.Foundation.Variants.Abstractions.Pipelines.GetVariants.GetSiteVariants, Sitecore.XA.Foundation.Variants.Abstractions" resolve="true"/>
<processor type="Sitecore.XA.Foundation.Variants.Abstractions.Pipelines.GetVariants.GetLinkedVariants, Sitecore.XA.Foundation.Variants.Abstractions" resolve="true"/>
<processor type="Sitecore.XA.Foundation.Variants.Abstractions.Pipelines.GetVariants.GetSharedVariants, Sitecore.XA.Foundation.Variants.Abstractions" resolve="true"/>
<processor type="Sitecore.XA.Foundation.Variants.Abstractions.Pipelines.GetVariants.FilterVariants, Sitecore.XA.Foundation.Variants.Abstractions" resolve="true"/>
</getVariants>
GetSharedVariants
should be before GetSiteVariants
processor.
Patch file like this should do the trick:
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"
xmlns:env="http://www.sitecore.net/xmlconfig/env/"
xmlns:role="http://www.sitecore.net/xmlconfig/role/">
<sitecore>
<pipelines>
<getVariants>
<processor type="Sitecore.XA.Foundation.Variants.Abstractions.Pipelines.GetVariants.GetSharedVariants, Sitecore.XA.Foundation.Variants.Abstractions">
<patch:delete />
</processor>
<processor type="Sitecore.XA.Foundation.Variants.Abstractions.Pipelines.GetVariants.GetSharedVariants, Sitecore.XA.Foundation.Variants.Abstractions"
resolve="true"
patch:before="processor[@type='Sitecore.XA.Foundation.Variants.Abstractions.Pipelines.GetVariants.GetSiteVariants, Sitecore.XA.Foundation.Variants.Abstractions']" />
</getVariants>
</pipelines>
</sitecore>
</configuration>