public override ActionResult Index(ProductTeaserBlock currentContent) { var model = new ProductTeaserBlockViewModel(currentContent); // The tag is set in the ViewData in the ContentAreaWithDefaultsRenderer.GetContentAreaItemCssClass() method model.Tag = ControllerContext.ParentActionViewContext.ViewData["Tag"] as string; return(View(model)); }
public override ActionResult Index(ProductTeaserBlock currentContent) { var model = new ProductTeaserBlockViewModel(currentContent); // My experiences: If there is a View with the same name as the Model, then that view is chosen before the controller, // unless an override exists in the database (admin->contenttype->blocktypes->productteaserblock->settings) // The tag is set in the ViewData in the ContentAreaWithDefaultsRenderer.GetContentAreaItemCssClass() method model.Tag = ControllerContext.ParentActionViewContext.ViewData["Tag"] as string; return(View(model)); }