自定义页面布局中的占位符图像 [英] Placeholder Image in Custom Page Layout
问题描述
我有一个自定义页面布局,需要包含一个占位符标题图像,当用户创建新页面时,该图像在初始页面视图上可见.当用户编辑页面时,他们应该能够用自己的图像替换它.
I have a custom page layout that needs to include a placeholder banner image that is visible on the initial page view when a user creates a new page. When the user edits the page, they should be able to replace it with their own image.
我尝试创建自定义代码段(请参见下文),但会触发错误.
I tried creating a custom snippet (see below) but it triggers an error.
<!-CS:从自定义ASP.NET标记代码段开始创建代码段->
<!-SPM:< asp:ContentPlaceHolderid ="BannerImagePlaceHolder" runat =服务器">
< img class ="img响应式" src = example url /1200x300_placeholder.jpg " />
</asp:ContentPlaceHolder>->
<!-CE:结束从自定义ASP.NET标记代码段创建代码段->
<!--CS: Start Create Snippets From Custom ASP.NET Markup Snippet-->
<!--SPM:<asp:ContentPlaceHolderid="BannerImagePlaceHolder" runat="server">
<img class="img-responsive" src=example url/1200x300_placeholder.jpg" />
</asp:ContentPlaceHolder>-->
<!--CE: End Create Snippets From Custom ASP.NET Markup Snippet-->
我正在使用SP 2013,并且只能使用SP Designer和Design Manager,而不能使用Visual Studio.
I'm using SP 2013 and can only use SP Designer and Design Manager not visual studio.
谢谢
内特
推荐答案
我建议您为此使用Content Editor/Script Editor Web部件,因为使用了ContentPlaceHolder在母版页中.
最好的问候,
Lee
这篇关于自定义页面布局中的占位符图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!