Orchard Core 文档翻译 (五)自动路由 Autoroute (OrchardCore.Autoroute)
Autoroute (OrchardCore.Autoroute)
此模块允许您为内容项指定自定义URL(永久链接 permalink)。
Autoroute Part
将此部分附加到内容类型以指定内容项的自定义URL。
然后,转到内容类型的定义并编辑 Autoroute Part:
- 使用Liquid表达式输入Pattern,该表达式将表示生成的slug。
具有TitlePart的内容的示例将使用它来生成slug:
{{ ContentItem | display_text | slugify }}
具有ListPart和TitlePart(ig:BlogPost嵌套在博客中)的内容示例将使用容器和标题生成slug:
{{ ContentItem | container | display_text | slugify }}/{{ ContentItem | display_text | slugify }}`
- 如果您希望在编辑内容项时能够输入自定义路径,请选中“Allow custom path”。
- 如果您希望能够将内容项目设置为主页,请选中 'Show homepage options'
Autoroute Alias
只要您可以通过别名检索内容,就可以通过URL检索具有Autoroute的内容项(请参阅下面的示例)。这个语法是 slug:<URL>, e.g. slug:my-blog/my-blog-post.
Liquid
启用Autoroute后,您可以在liquid 视图和templates中按URL检索内容:
{% assign my_content = Content["slug:my-blog/my-blog-post"] %}
or
{% assign my_content = Content.Slug["my-blog/my-blog-post"] %}
Orchard Core 文档翻译 (五)自动路由 Autoroute (OrchardCore.Autoroute)的更多相关文章
- Orchard Core 文档翻译 (三) Orchard Core Modules
原文连接:https://www.cnblogs.com/Qbit/p/9746442.html 转载请注明出处 介绍 Orchard Core Modules库提供了一种机制,可以拥有一个独立的模块 ...
- Orchard Core 文档翻译 (二)代码生成模板 Code Generation Templates
Code Generation Templates 翻译原文:https://www.cnblogs.com/Qbit/p/9746457.html转载请注明出处 Orchard Core Templ ...
- Orchard Core 文档翻译 (四)CMS ModulesTitle (OrchardCore.Title)
Title (OrchardCore.Title) 标题模块提供Title Part ,允许用户定义内容项的标题.它还定义了ContentItemMetadata方面的DisplayText属性 Th ...
- Orchard Core 文档翻译 (七)Contents
CMS Modules »Contents Contents (OrchardCore.Contents) 此模块提供内容管理服务. Liquid 您可以使用“content ”属性从liquid 视 ...
- Orchard官方文档翻译(五) Dashboard相关
原文地址:http://docs.orchardproject.net/Documentation/Getting-around-the-dashboard 想要查看文档目录请用力点击这里 最近想要学 ...
- Orchard Core 文档翻译 (六)HTML
Body (OrchardCore.Html) Theming Shapes 将HtmlBodyPart附加到内容类型时,将呈现以下形状(Shapes) Name Display Type Defau ...
- Orchard core 中文文档翻译系列
本系列翻译顺序完全参照 官方顺序 原文地址:https://orchardcore.readthedocs.io/en/latest/ Orchard Core 中文文档翻译(一)关于Orchard ...
- Orchard Core 使用工作流处理审批和创建内容项
译自:http://www.ideliverable.com/blog/orchard-core-workflows-walkthrough-content-approval 转载请注明出处, 原文地 ...
- ExpandoObject与DynamicObject的使用 RabbitMQ与.net core(一)安装 RabbitMQ与.net core(二)Producer与Exchange ASP.NET Core 2.1 : 十五.图解路由(2.1 or earler) .NET Core中的一个接口多种实现的依赖注入与动态选择看这篇就够了
ExpandoObject与DynamicObject的使用 using ImpromptuInterface; using System; using System.Dynamic; names ...
随机推荐
- 【研究】curl测试不安全的HTTP请求
漏洞名称: 启用了不安全的HTTP方法 安全风险: 可能会在Web 服务器上上载.修改或删除Web 页面.脚本和文件. 可能原因: Web 服务器或应用程序服务器是以不安全的方 ...
- OPENROWSET read excel
由于64位系统已经不支持 oledb 4.0访问 xls 1. 未在本地计算机上注册“microsoft.ACE.oledb.12.0”提供程序 去http://download.microsoft. ...
- JS实现跨域请求数据--jsonp
* { margin: 0; padding: 0; } input { width: 300px; height: 30px; border: 1px solid lightgray; margin ...
- win10 sshsecureshellclient删除profile保存的信息
C:\Users\joe\AppData\Roaming\SSH
- docker~环境变量到底怎么用
docker已经用了两年多了,从开始的简单应用到现在的自动化部署,已经越来越感觉到它的威力,今天把Hitchhiker部署完成后,看到了它与.net core项目有个类似的地方,就是对于多环境部署的时 ...
- 关于TypeScript中null,undefined的使用
TypeScript本质是javascript,因此基本上js所有的功能在ts上完全可以照搬照抄过来使用.根据ts的文档,有些我觉得值得商榷的——比如null,undefined就是例子. 文档上说一 ...
- 动态替换animator的研究
http://blog.csdn.net/tonnychu/article/details/49903657 http://blog.csdn.net/tlrainty/article/details ...
- Web请求过程总结
Web请求过程总结 1.CND架构图 图片来源:深入分析JavaWeb技术内幕(许令波著) 2.发起HTTP请求 发起一个HTTP请求就是浏览器建立socket通信的过程,HttpClient开源的通 ...
- pat00-自测1. 打印沙漏(20)
00-自测1. 打印沙漏(20) 时间限制 200 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 CHEN, Yue 本题要求你写个程序把给定的符号打 ...
- Hadoop 2.7.2 集群搭建(转载)
http://blog.csdn.net/u010048823/article/details/51913608