Set placeholder restrictions
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.
Set placeholder restrictions in the Content Editor
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:
-
Navigate to the Presentation folder of your site, right-click Placeholder Settings, click Insert, and then click Placeholder.
-
Enter a name and click Ok.
-
In the Data section, in the Allowed Controls field, click Edit.
-
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.
-
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.
NoteIf you add placeholder restrictions to all the placeholders of a page, then the Toolbox displays only the renderings that are allowed.
Set placeholder restrictions in the Experience Editor
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:
-
In the relevant placeholder, click Edit placeholder settings.
-
In the Select the Placeholder Settings dialog box, click Create New Settings.
NoteTo use an existing restriction, click Select Existing Settings, click the placeholder restriction and click OK.
-
To add renderings, click Edit and click OK.
-
In the Select Items dialog box, navigate to Layout\Rendering\Feature\Experience Accelerator, select the renderings that you want to enable, and click OK.
Merge placeholder restrictions
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:
-
To add placeholder restrictions for a partial design, open the partial design in the Experience Editor
-
In the placeholder, click Edit placeholder settings
-
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.
-
Click Edit to add renderings and click OK. For example, add search renderings.
Now the partial design allows only search renderings:
You can now merge the restrictions of the partial design with the global restrictions that are set for a page.
-
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.
-
Click Edit to add renderings, for example, page content and media renderings, and click OK.
-
Refresh the page. You can see that the settings are merged.