1

과수원 모듈에 새 페이지를 작성하려면 어떻게합니까? 과수원에 한 페이지와 컨트롤러가 있지만 루트 모듈에 새 페이지를 추가하는 방법은 무엇입니까?과수원 모듈에 새 페이지 작성

 public IEnumerable<RouteDescriptor> GetRoutes() { 
     return new[] { 
      new RouteDescriptor { 
       Priority = 5, 
       Route = new Route(
        "BlogX", // this is the name of the page url 
        new RouteValueDictionary { 
         {"area", "BlogX"}, // this is the name of your module 
         {"controller", "Home"}, 
         {"action", "Index"} 
        }, 
        new RouteValueDictionary(), 
        new RouteValueDictionary { 
         {"area", "BlogX"} // this is the name of your module 
        }, 
        new MvcRouteHandler()) 
      } 
     }; 
    } 

답변

1

이것은 쉬워야합니다. 컨트롤러에 Orchard.ContentManagement.IContentManager의 인스턴스를 삽입 한 다음 ContentManager.New("YourContentType")으로 전화하십시오. 또한 Publish()과 같은 콘텐츠 관리자에서 사용할 수있는 다른 방법을 살펴보십시오.이 메서드는 호출해야 할 수도 있습니다.