Tags

, , , , , , , ,

Hi Friends,

I will be covering 2 issues in the below article. First one is related to SubLayout in “Allowed Control” in Placeholder not working and another one is config file for Patch:delete.

Background: Our Sitecore 7.0 webform based site was upgraded to 9.1 last year. After that, we added a few more sites and added SXA as well.

Issue: Recently we noticed that the Authors have used wrong controls in placeholders on our main website, so we decided to set the “Allowed control” in Placeholder setting. After introducing the SubLayouts in the Allowed control, we found issue in the Experience Editor. In Exp. Editor, Authors or Admin are not able to select any component to add in the Placeholder. They see a blank ‘Select a Rendering’ popup. We tried the same by adding a few Sublayouts and Renderings options in Allowed control. But only the renderings were visible SubLayouts were not visible.

Solution: We created a Sitecore support ticket. The Sitecore team found that there is a processor installed with SXA, which blocks the sublyout to display in “select a rendering” popup. And suggested to comment the processor or create a custom processor to override the same functionality.

To resolve the issue, We decided to create a Patch file to delete the same processor. When started searching I didn’t find anything really helpful. Most articles were related to Add, Update etc. But information about delete was less so I created a Patch Delete file and pasting it here to explain the same.

<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <pipelines>
      <preprocessRequest>
        <processor type="Sitecore.XA.Foundation.Presentation.Pipelines.GetPlaceholderRenderings.FilterRenderings">
          <patch:delete />
        </processor>
      </preprocessRequest>
    </pipelines>
  </sitecore>
</configuration>

To Explain the config file above. Find the Sitecore Item you want to Delete/comment and get the correct path. Create the same path structure in your config file and under the final element which you want to remove, just add <patch:delete />.