Sitecore MVC确保在体验编辑器中可以选择空的占位符 [英] Sitecore MVC Ensure empty placeholder is selectable in experience editor

查看:103
本文介绍了Sitecore MVC确保在体验编辑器中可以选择空的占位符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Sitecore MVC中的占位符是否有一些技巧,以确保即使它们不包含任何渲染,也总是可以在页面编辑器体验编辑器中选择它们?我的控制器渲染在cshtml视图中声明了占位符,如下所示:

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>

推荐答案

为确保占位符的可见性和选择性,您需要确保以下内容:

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

  1. Sitecore中存在一个占位符设置项,它与cshtml呈现中声明的正确Placeholder Key匹配.
  2. 占位符设置项已选中Editable设置.
  3. 页面中的CSS不会阻止占位符可见.
  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.

这篇关于Sitecore MVC确保在体验编辑器中可以选择空的占位符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆