如何查询 Umbraco 的 7.X 页面设置(Grid Layout)来创建菜单?

How to query Umbraco's 7.X page setting (Grid Layout) to create a menu?

我正在使用 Umbraco 7.3.3 创建带有垂直视差滚动菜单的主页。我的方法是为每个特定部分创建一个 Editor/View 并使用一个设置(来自网格布局 属性 编辑器)来呈现我将用作主导航锚点的 ID。

我也曾尝试将这些部分创建为子文档,但它无法自由地重新排序这些部分。

第一个选项是创建带有视差滚动导航的网格布局的最佳方法吗?有人可以指出 different/better 创建 "scroll down" 导航菜单的方法吗?

backbone 可以,但我不知道如何在 MainNavigation.cshtml Partial 下查询 CurrentPage 的设置(我正在使用 Fanoe Starter Kit)。

如何通过特定的 CurrentPage 设置进行查询?

我期待这样的结果:

// first try (Does NOT work)
CurrentPage.GetProperty("content").Where(s => s.some lambda expression)

//another tried option based on GetGridHtml method (Does NOT work)
CurrentPage.GetGrid("content")...

这是菜单中应该有导航项的每一行的设置配置:

  [{
    "label": "Section Name",
    "description": "Type the section name",
    "key": "id",
    "view": "textstring",
    "applyTo": "row"
  }]

我做了额外的研究,我发现 (here and here) 没有 API 处理网格布局编辑器存储的序列化 JSON。

Limitations With the above usage scenarios in mind, consider the grids limitations. First of all, all content entered into the grid is stored as a single property value on the content node, as a big JSON object. This means that as soon as the values are stored in the database, there is no managed api to drill into the grid content and target specific cell content - so a grid layout is not a recommended storage of reusable content - it simply wasn't designed for this scenario. If you wish to reuse content in multiple pages, it is still recommended that you store these pieces of content as separate content nodes, so they can be stored, cached and queried as usual.