你怎么覆盖果园CMS导航区的呈现? [英] how do you override the rendering of the Navigation zone in Orchard CMS?
问题描述
我是新来的果园,所以我可能不知道我在做什么。
I'm new to Orchard, so I probably have no idea what I'm doing.
我已经想通了如何覆盖不同的形状,但把一个CSHTML文件中查看文件夹的名称相同的形状。
I've figured out how to override different shapes but putting a cshtml file in the View folder with the same name as the shape.
另外,我发现菜单和菜单项形状CSHTML文件核心果园文件下。
Also, I found the Menu and MenuItem shape cshtml files under the Core Orchard files.
不过,我没有看到一个名为导航状态,我真的不明白特区是如何工作的。
However, I don't see a shape named Navigation and I don't really understand how Zones work.
我搜索了code和无法弄清楚导航究竟是如何呈现的,虽然我确实发现了一些code的。
I searched the code and couldn't figure out exactly how the Navigation is rendered, though I did find some of the code.
这是我要重写导航呈现的是它呈现一个DIV和周围的UL资产净值标签的原因。我想preFER只是呈现NAV和UL认证。
The reason that I want to override the Navigation rendering is that it renders a DIV and a NAV tag around the UL. I would prefer to just render the NAV and UL.
推荐答案
区域也塑造,但他们在code声明(核心/图形/ CoreShapes.cs 的),而不是在.cshtml文件最喜欢的形状。此外,不存在形状称为导航,因为区域是在运行时动态创建的。 - 通过使用的主题被提供那些的名称
Zones are also shapes, but they are declared in code (Core/Shapes/CoreShapes.cs), not in .cshtml files like most of shapes. Also, there is no shape called Navigation, as zones are created dynamically at runtime - names of those are provided by the theme used.
区已默认交替形式的 __区[ZONENAME]。 这意味着你只需要把区-Navigation.cshtml 中/浏览文件夹中的文件你的主题文件夹覆盖导航区域渲染。的
Zones have default alternates in the form Zone__[ZoneName]. It means you just need to put Zone-Navigation.cshtml file in /Views folder in your theme folder to override Navigation zone rendering.
这篇关于你怎么覆盖果园CMS导航区的呈现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!