The best practice advises Sitecore CMS developers to be mindful of the modules they allow in placeholders rather than allowing every module to be placed everywhere.
While this practice may seem pretty straightforward and obvious if you do it right, not getting it employed makes the content management system feel sloppy and creates an impression that your solution is unfinished and untidy (which to be frank... in this case, it is). To add insult to injury, it's not just that some modules will not make sense in some placeholders, they will look just plain ugly there.
The solution to the problem however is well supported and strongly endorsed by Sitecore.
When a placeholder is put on a page, it has to be determined what modules are valid within that placeholder and the list should be narrowed so the authors can just use the required modules rather than be presented with the list of all renderings available in the system.
While designing the site, we assume that some modules can be placed only in certain chosen placeholders. The same principle concerns placeholders - some of them can contains particular modules only. The reason can be that the control does not fit with the layout of a page type, control can be too wide for the column, etc. That is why, sometimes we want to restrict the list of the allowed controls.
On the homepage, we allow only summary and tweets modules to be displayed in bottom right section of the page. That is why, while adding a new control to this placeholder authors should not be presented with the option of adding other controls there:
How do I implement it in my project?
In Content Editor navigate to Layout -> Placeholder Settings -> chosen placeholder. Change the Allowed Controls property so only the proper modules are chosen (see screenshot):
Big thanks to Marek Musielak for his research and help on the Sitecore Best Practice 4.
27 May 2011Adam Najmanowicz
28 March 2019Andrzej Pucilowski
16 November 2016Ioannis Verikis
People in or team love to share their experience. Explore our blog
We're always looking for new faces to join the Cognifide family. Take a look at our available jobs.