生成基于分层菜单上的果园CMS Autoroutes果园、菜单、Autoroutes、CMS

2023-09-05 01:03:29 作者:矫情你麻痹°

我有一组在果园自定义内容类型的页面都设置在高级菜单,如下所示:

I have a set of custom content type pages in Orchard that are set up in an advanced menu like so:

标题:父页 位置:1

Title: Parent Page Position: 1

标题:儿童页 位置:1.1

Title: Child Page Position: 1.1

标题:孙页 您的位置:1.1.1

Title: Grandchild Page Position: 1.1.1

现在每个人都有反映的名称(例如,/亲子页/子页,/孙子页)。

Right now each has a URL that reflects the name (eg., /parent-page, /child-page, /grandchild-page).

如何才能让我的自定义内容类型的URL生成层次的网址(例如,/亲子页/父页/儿童页/父页/子页/孙子页)自动?

How can I get the URLs for my custom content types to generate hierarchical urls (eg., /parent-page, /parent-page/child-page, /parent-page/child-page/grandchild-page) automatically?

-Carson

推荐答案

如果您有家长一个道理,你可以做分类法正在做他们的默认别名模式。 这使我反对我会的实际问题。它不应该是在导航该模型的内容的结构而是被反射在菜单中的内容的结构。因此,我将开始与内容的很好的分类,并生成从该导航。如果你这样做,你的网址是正确的,立即。

If you have a token for the parent, you can do what taxonomies are doing for their default alias pattern. Which brings me to the objection I would have to the actual question. It should not be the navigation that models the structure of contents but rather the structure of the contents that is reflected in the menu. So I would start with a good taxonomy of the contents and generate navigation from that. Your URLs would be right immediately if you did that.

 
精彩推荐