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 ...
随机推荐
- Codeforces - 631B 水题
注意到R和C只与最后一个状态有关 /*H E A D*/ struct node2{ int kind,las,val,pos; node2(){} node2(int k,int l,int v,i ...
- win10 sshsecureshellclient删除profile保存的信息
C:\Users\joe\AppData\Roaming\SSH
- zTree 图标样式
<link rel="stylesheet" href="jquery/ztree/css/zTreeStyle/zTreeStyle.css" /> ...
- select简单示例,有注释
全部都在代码中: import select import socket import queue """ 简单的select 实现echo server 个人理解: s ...
- springMVC静态资源访问
springMVC默认是访问不到静态资源的,如css,js等,需要在xml里进行配置 保证已经配置好了 web.xml, <!-- Spring MVC servlet --> <s ...
- Java入门系列-07-从控制台中接收输入
这篇文章帮你使用Scanner类从控制台接收输入 从控制台接收字符串 敲一敲: import java.util.Scanner; public class DemoScanner { public ...
- nyoj 568——RMQ with Shifts——————【线段树单点更新、区间求最值】
RMQ with Shifts 时间限制:1000 ms | 内存限制:65535 KB 难度:3 描述 In the traditional RMQ (Range Minimum Q ...
- Sturct类型装箱时会遇到的问题
Object在拆箱时会在栈空间生成一个临时变量.所以Struct在使用时尽量将内容都声明为readonly为好 [<Struct>] type Point= val mutable X:d ...
- reload()与reload(true)
如果该方法没有规定参数,或者参数是 false,它就会用 HTTP 头 If-Modified-Since 来检测服务器上的文档是否已 改变.如果文档已改变,reload() 会再次下载该文档.如果文 ...
- CSP学习之CryptoAPI初识
Crypto API目的就是提供开发者在windows下使用PKI的编程接口. Crypto 提供了很多的加解密相关函数,如编码.解码.加密解密,哈希,数字证书.证书管理证书存储等. 有关 ...