如果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