如果Wildcard Module是行不通的,如果这是你的Sitecroe实例中的所有网站的情况下,你可以写一个自定义项目解析器和插入处理器在内置的项目解析器之后的httpBeginRequest管道中。
这有点从内存中,但应该让你开始:
namespace Example
{
public class CategoryItemRewsolver : Sitecore.Pipelines.HttpRequest.HttpRequestProcessor
{
public override void Process(HttpRequestArgs args)
{
if (Sitecore.Context.Item != null) return; // Item has already been resolved
if (args.Context.Request.Path.StartsWith("Category"))
{
Sitecore.Context.Item = Sitecore.Context.Database.GetItem("sitecore/Root/Global" + args.Context.Request.Path);
}
}
}
}
你会明显地想换成自己的路径(也可能让他们通过config文件进行配置)。
然后打补丁到管道这样的:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<httpRequestBegin>
<processor patch:after="*[@type='Sitecore.Pipelines.HttpRequest.ItemResolver, Sitecore.Kernel']" type="Example.CategoryItemResolver,Example" />
</httpRequestBegin>
</pipelines>
</sitecore>
</configuration>
听起来像一个很好的候选人[项目克隆(http://www.sitecore.net/Learn/Blogs/Technical-Blogs/John-West- Sitecore的-博客/职位/ 2010/10/Sitecore的-CMS-6-4的克隆。aspx) – jammykam 2014-10-09 09:58:37
请建议我该如何做到这一点。 – Soni 2014-10-09 11:32:45