是否可以为 Orchard 中的 List 创建替代方案?
我只想自定义列表视图。
是否可以?我想是的。如何?
如何命名内容类型列表的替代名称,例如“问题”
I just want to customize List view.
is it possible? I think yes. How?
How to name alternative for List of Content types, let say, "Question"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当然。由于问题的背景有点模糊,我会做出假设。我假设您有一个构建列表的控制器操作(类似于博客正在做的事情)。从操作中,您通常会使用如下所示的代码构建一个列表形状:
看到末尾附近的那一行了吗?它添加了替代方案,以便您可以通过在主题的视图文件夹中创建名为 list.things.cshtml 的文件来为该特定列表构建特定模板。
Sure. As the question is a little vague about context, I'll make assumptions. I'll assume that you have a controller action building the list (similar to what the blog is doing). From the action, you are usually building a list shape with code looking something like this:
See that line near the end? It's adding the alternate, so that you can build a specific template for that particular list by creating a file named list.things.cshtml in the views folder of your theme.