- Under Placeholder Settings folder, create another Placeholder Settings folder and call it "SiteX". This gives us division for organizing. We assume you are creating a naming convention like this already for other areas of the sitecore structure. So use the naming convention and structure you are most comfortable with.
- Inside Placeholder Settings/SiteX create a Placeholder Settings item and name it "content".
- On our new item "content", leave the Placeholder Key blank, but add the control "ControlX" under the allowed controls. Make sure editable field is checked on, and add a description if necessary.
- Finally under each page type template, open Presentation > Details, edit, and select the Placeholder Settings tab. From here you can add the placeholder settings item and add it to placeholder content.
Placeholder's in a Sitecore Multi site Solution
No longer are the days of Sitecore where developers stack the presentation layer and that is the page the author writes content for. With the addition of the page editor, the content author can take on a much larger design role. One page type can now be stretched to create much more custom pages with a little planning and some creativity. But along with this flexibility there are some complexities to consider. Before we talk about a multi-site solution, let's take a step back and talk about placeholder settings in general. The placeholder settings folders is located at the root of the Layouts folder. Inside here you can create a placeholder item which is fairly simplistic. If you populate the Placeholder Key field with your placeholder, and layouts / renderings placed in the Allowed Controls field will be accessible by the content author to insert. Furthermore on each layout / rendering we want to allow we can identify the Datasource Location and Datasource Template on that item to allow the author to relate data to the control. Now in a multi-site solution you will plan to allow your authors to insert controls, but where the problem comes into play is when two sites share the same placeholder name. We usually generalize our placeholder naming structure to the point where names like "content", "main", "left", or "right" are fairly common. This scenario could result in authors gaining access to controls meant for other sites. But this is fine, as there is a step up to making this work. First of all get rid of the idea of using the "Placeholder Key" field. Unless you can identify something global enough that it will always span every site in your solution, this field should never be populated. Instead we will attach the placeholder settings specific to our page type templates. Here is a step by step approach to adding ControlX to placeholder "content" for SiteX:
Categories: Content Management