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:
Nathan Heskew
2010-08-31 11:50:07 -07:00
parent 4787040523
commit dec2775d47
10 changed files with 66 additions and 56 deletions

View File

@@ -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