mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Starting to break stuff in order to make things better...(starting w/ the Contents module)
Many modules are disabled by default to keep them out of the way for now. Run through the setup and hit ~/Contents/Item/Display/3 to get the homepage page --HG-- branch : dev extra : transplant_source : %8EH%F5%06%12%1D%3D%FC%7Bl%D6p%CF%DB%DAp%BF%1C%DB%A5
This commit is contained in:
@@ -1,29 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Core.Contents.ViewModels;
|
||||
using Orchard.DisplayManagement;
|
||||
using Orchard.Mvc.ViewModels;
|
||||
|
||||
namespace Orchard.Core.Contents.Controllers {
|
||||
public class ItemController : Controller {
|
||||
private readonly IContentManager _contentManager;
|
||||
|
||||
public ItemController(IContentManager contentManager) {
|
||||
public ItemController(IContentManager contentManager, IShapeHelperFactory shapeHelperFactory) {
|
||||
_contentManager = contentManager;
|
||||
Shape = shapeHelperFactory.CreateHelper();
|
||||
}
|
||||
|
||||
dynamic Shape { get; set; }
|
||||
|
||||
// /Contents/Item/Display/72
|
||||
public ActionResult Display(int id) {
|
||||
var contentItem = _contentManager.Get(id, VersionOptions.Published);
|
||||
|
||||
var model = new DisplayItemViewModel {
|
||||
Content = _contentManager.BuildDisplayModel(contentItem, "Detail")
|
||||
};
|
||||
PrepareDisplayViewModel(model.Content);
|
||||
return View("Display", model);
|
||||
var model = Shape.Content(
|
||||
_contentManager.BuildDisplayModel(contentItem, "Detail")
|
||||
);
|
||||
//PrepareDisplayViewModel(model.Content);
|
||||
return View(model);
|
||||
}
|
||||
|
||||
// /Contents/Item/Preview/72
|
||||
|
||||
Reference in New Issue
Block a user