SDL Tridion 2011 および ASP.NET MVC4 で DD4T フレームワークを使用しています。
DD4T 以外のコントローラーとビューを使用したいのですが、これらの URL にアクセスしようとすると 404 エラーが発生します。
これは私のルートテーブルです
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
// Route for SDL Tridion UI 2011 (Aka !SiteEdit)
routes.MapRoute(
"SiteEditBlankPage",
"se_blank.html",
new { controller = "Empty", action = "Index" });
routes.MapRoute(
null, // Route name
"xml/{*PageId}", // URL with parameters
new { controller = "Page", action = "Xml" }, // Parameter defaults
new { pageId = @"^(.*)?$" } // Parameter constraints
);
// Tridion page route
routes.MapRoute(
"TridionPage",
"{*PageId}",
new { controller = "Page", action = "Page" }, // Parameter defaults
new { pageId = @"^(.*)?$" } // Parameter constraints
);
routes.MapRoute(
null, // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
}
デフォルト ルートを Tridion の上に移動しようとしましたが、Tridion ページで 404 が発生します。
それを機能させる唯一の方法は、コントローラーへの特定のルートを設定することです。
routes.MapRoute(
null, // Route name
"MyController/{action}/{id}", // URL with parameters
new { controller = "MyController", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
誰にもアイデアはありますか?上記のソリューションは理想的ではありません。
(web.config に UI 2012 構成がありません)