用一把umbraco web表单显示网格值 [英] display grid value using webforms in umbraco

查看:242
本文介绍了用一把umbraco web表单显示网格值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的一把umbraco Web窗体模板来显示文档属性,如:

I am trying to display a document property in my webform template in umbraco, like this:

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

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <umbraco:item field="content" runat="server" />

</asp:Content>

但在内容我正在外地,没有价值的JSON描述,这里是输出:

But on the content i am getting a json description of the field, not the value, here is the output:

{ "name": "1 column layout", "sections": [ { "grid": 12, "rows": [ { "name": "Headline", "areas": [ { "grid": 12, "hasConfig": false, "controls": [ { "value": "
This is the content i am adding

", "editor": { "alias": "rte" }, "active": true } ] } ], "hasConfig": false, "id": "31604cf5-c263-0d98-8978-67e07390adff" } ] } ] }

图片连接

如何才能显示值属性?

感谢

推荐答案

呵呵,您使用的是网格数据类型。然后,我不认为你可以用一把umbraco:项目反正啄,不好意思:-S

Oh, you're using a Grid datatype. Then I don't think you can use the umbraco:item thingy anyways, sorry :-s

下面的方式来呈现网格HTML列表,但示例使用剃刀/ MVC:<一href=\"https://our.umbraco.org/documentation/getting-started/backoffice/property-editors/built-in-property-editors/grid-layout/render-grid-in-template\" rel=\"nofollow\">https://our.umbraco.org/documentation/getting-started/backoffice/property-editors/built-in-property-editors/grid-layout/render-grid-in-template

Here's a list of ways to render grid HTML, but the examples are using Razor / MVC: https://our.umbraco.org/documentation/getting-started/backoffice/property-editors/built-in-property-editors/grid-layout/render-grid-in-template

您可以尝试这样的事:

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <%= CurrentPage.GetGridHtml("content") %>
</asp:Content>

如果没有在列表中的例子工程,电网可能无法在Web窗体支持。请考虑使用(更现代的)MVC和剃须刀的方法,而不是 - 你可以在全新安装安装Fanoe入门套件,看看它是如何做

If none of the examples in the list works, grids might not be supported in Web Forms. Consider using the (more modern) MVC and Razor approach instead - you could install the Fanoe starter kit on a fresh installation and see how it's done?

这篇关于用一把umbraco web表单显示网格值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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