【问题标题】:Can't add content on pages using webform template in Umbraco无法在 Umbraco 中使用 webform 模板在页面上添加内容
【发布时间】:2016-07-30 09:18:14
【问题描述】:

我正在使用 umbraco 7,但我不太擅长 MVC,所以我使用的是 webforms,当我尝试使用 webform 模板时,我无法在页面上添加内容,只能在模板上添加。

在这里,我在 de default.master 文件中使用 contentplace 持有者,如下所示:

<div id="mainContent">
 <asp:ContentPlaceHolder id="MainContent" runat="server">
 </asp:ContentPlaceHolder>
 </div>

然后我创建名为“Text Webform”的模板,这是代码:

<%@ Master Language="C#" MasterPageFile="~/umbraco/Masterpages/Default.master" AutoEventWireup="true" %>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    This content is displayed

    Am i forgetting some code to add here?

</asp:Content>

Click on this to see screenshot

问题是当我尝试在使用“Text Webform”模板的页面中添加内容时,该内容未显示,如您在屏幕截图here中所见@

我确定我需要在 Text Webform 模板中添加一些内容,但我不知道具体是什么,我很绝望,请有人提供任何帮助,

谢谢。

【问题讨论】:

    标签: asp.net templates webforms umbraco master-pages


    【解决方案1】:

    您必须定义哪些字段(例如文档类型中的属性)以显示模板中的位置。我相信这就是你要找的? https://our.umbraco.org/documentation/Reference/Templating/Masterpages/umbracoitem - 只是

    【讨论】:

    • 那是用来显示文档属性的,这很好,但我只想在使用该模板的内容页面中添加内容,但没有显示此内容..我仍然迷失在这个所以请有人可以帮助我吗?
    • 不,在 asp:Content 标记中添加 umbraco:item 并将其指向模板的相关属性 - 如果您有一个带有别名 bodyText 的内容字段,那就是您指向的内容。文档类型中的所有内容都是属性。然后该模板将与 Umbraco 一起在正确的页面上显示正确的内容。
    【解决方案2】:

    好的,现在我可以解释得更好了,

    我只想要使用网络表单模板与 @CurrentPage.GetGridHtml("content", "fanoe") 相等的函数..

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-03-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-27
    相关资源
    最近更新 更多