Orchard Core Document translation (v) automatic routing Autoroute (Orchardcore.autoroute)

Source: Internet
Author: User

Autoroute (Orchardcore.autoroute)

This module allows you to specify a custom URL (permanent link permalink) for the content item.

Autoroute part

Attaches this section to the content type to specify a custom URL for the content item.

Then, go to the definition of the content type and edit the Autoroute part:

    • Use the liquid expression to enter pattern, which represents the generated slug.

An example of the content with Titlepart will use it to generate slug:

{{ContentItem|  Display_text|  Slugify}}     

Examples of content with Listpart and Titlepart (ig:blogpost nested in blogs) will generate slug using containers and headers:

{{ContentItem|  Container|  Display_text|  Slugify}}/{{ ContentItem|  Display_text|  Slugify}}'               

    • Select Allow custom Path if you want to be able to enter custom paths when editing content items.
    • If you want to be able to set the content item as the home page, check the ' Show homepage options '
Autoroute Alias

As long as you can retrieve content from an alias, you can retrieve the content item with autoroute through the URL (see the example below). This syntax is slug:<URL> , e.g. slug:my-blog/my-blog-post

Liquid

When autoroute is enabled, you can retrieve content by URL in liquid view and templates:

{%assignmy_content=content["slug: my-blog/my-blog-post"]%}   

Or

{%assignmy_content= content.slug["my-blog/my-blog-post"]%}    

Orchard Core Document translation (v) automatic routing Autoroute (Orchardcore.autoroute)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.