Ok, so I found that I needed to create a DataType that has an existing Macro container Property editor. This suits my needs perfectly, however, since I am using Ajax to show my page content, all I get back when pulling the content from my controller is . How do I actually get the macro content? Should this be done in the controller?
Here's my Ajax controller:
public ActionResult GetPage(int id) {
var page = new Node(id); if (page == null || page.GetProperty("body") == null) return Content(@"Hmm, something went wrong. Unable to find what you're looking for.");
return Content(page.GetProperty("body").Value); }
Yes, my Macro Container, Document Type, Property name is Body
Umbraco 7 Macro/Partial View Picker Datatype
I'm trying to get help creating a DataType that lets me show a Partial View to the end user. Something similar to this http://macropicker.codeplex.com/ or perhaps http://umbraco.com/help-and-support/video-tutorials/umbraco-fundamentals/datatypes/using-the-macro-container-datatype/TVPlayer however for Umbraco 7 using the MVC/Partial View way
Ok, so I found that I needed to create a DataType that has an existing Macro container Property editor. This suits my needs perfectly, however, since I am using Ajax to show my page content, all I get back when pulling the content from my controller is . How do I actually get the macro content? Should this be done in the controller?
Here's my Ajax controller:
public ActionResult GetPage(int id)
{
var page = new Node(id);
if (page == null || page.GetProperty("body") == null)
return Content(@"Hmm, something went wrong. Unable to find what you're looking for.");
return Content(page.GetProperty("body").Value);
}
Yes, my Macro Container, Document Type, Property name is Body
Here's my question in detail on StackOverflow http://stackoverflow.com/questions/21899185/umbraco-7-partial-view-macro-rendering
is working on a reply...