sitecoresitecore8sitecore-mvcpage-editorexperience-editor

Sitecore MVC Ensure empty placeholder is selectable in experience editor


Is there some trick with placeholders in Sitecore MVC to ensure that they are always selectable in the page editor experience editor even when they don't contain any renderings? My controller rendering declares the placeholder in the cshtml view as follows:

<div>
  <!-- some html markup and fields rendered here --> 
  @Html.Sitecore().Placeholder("my-component-placeholder")
</div>

Solution

  • To ensure placeholder visibility and selectability, you need to ensure the following:

    1. A placeholder settings item exists in Sitecore with the correct Placeholder Key matching that declared in the cshtml rendering.
    2. The placeholder settings item has the Editable setting checked.
    3. The CSS in the page is not preventing the placeholder from being visible.