Set placeholder restrictions

Abstract

Control use of renderings for specific placeholders.

SXA enables content owners to construct web pages by dragging renderings from the Toolbox to the page. When you click and start dragging a rendering, the placeholders where you can drop the rendering light up in blue.

To have some control over the renderings that can be placed in a placeholder, you can set placeholder restrictions. For example, if you want the footer design to be simple, without too much information, you can restrict complex renderings.

In the Content Editor, you can set placeholder restrictions for your layout placeholders. These restrictions are applied on all pages in the site. For example, if you add restrictions for a footer, these apply for all footers on every page of the site. In this way, you can control the content that content owners can place in layout placeholders.

To add a placeholder setting for a site:

  1. Navigate to the Presentation folder of your site, right-click Placeholder Settings, click Insert, and then click Placeholder.

  2. Enter a name and click Ok.

  3. In the Data section, in the Allowed Controls field, click Edit.

    Allowed Controls field.
  4. In the Select Items dialog box, navigate to Layout/Rendering/Feature/Experience Accelerator and select the renderings that you want to enable, and then click OK. For example, if you want a very simple footer, enable only the Rich Text (Reusable), Twitter, and Link renderings for the footer.

    Select Items dialog.
  5. Save the placeholder setting.

    Now in the Experience Editor, when you click Add here, for example, in the footer, you can only select the renderings that you just added. Other renderings can still appear in the Toolbox but the content owner is not able to drag them to the placeholder.

    Add footer
    Select a rendering.

    Note

    If you add placeholder restrictions to all the placeholders of a page, then the Toolbox displays only the renderings that are allowed.

When you have set a placeholder restriction for the whole site, you can select this restriction in the Experience Editor. You can also create new placeholder restrictions in the Experience Editor.

To set a new placeholder restriction in the Experience Editor:

  1. In the relevant placeholder, click Edit placeholder settings.

  2. In the Select the Placeholder Settings dialog box, click Create New Settings.

    Note

    To use an existing restriction, click Select Existing Settings, click the placeholder restriction and click OK.

  3. To add renderings, click Edit and click OK.

    Select the placeholder settings dialog box.
  4. In the Select Items dialog box, navigate to Layout\Rendering\Feature\Experience Accelerator, select the renderings that you want to enable, and click OK.

You can merge globally set placeholder restrictions with restrictions set for partial designs or specific placeholders on a page. For example, if you want to disable search renderings on all main placeholders but allow adding them on a partial design or a search page.

To merge placeholder restrictions:

  1. To add placeholder restrictions for a partial design, open the partial design in the Experience Editor

  2. In the placeholder, click Edit placeholder settings

  3. In the Select the Placeholder Settings dialog box, click Create New Settings. For example, you can set a restriction for the main placeholder under (page) data.

  4. Click Edit to add renderings and click OK. For example, add search renderings.

    2BB89275D05A4E99AAD51828031D3C2F.png

    Now the partial design allows only search renderings:

    17644DADFD024509994C90C062E9376F.png

    You can now merge the restrictions of the partial design with the global restrictions that are set for a page.

  5. Open a page with a page design that contains the partial design that you just set restrictions for. In the main placeholder, click Edit placeholder settings and in the Select the Placeholder Settings dialog box, click Create New Settings. For example, you can set some restrictions for the main placeholder under (page) data.

    E5F7FEEF08C1477A9E0AE45AF3D67E56.png
  6. Click Edit to add renderings, for example, page content and media renderings, and click OK.

  7. Refresh the page. You can see that the settings are merged.

    2C00A5460A6E42028799CABEBDDE5C45.png