Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Sergey Sagan 5 posts 25 karma points
    Feb 19, 2014 @ 05:44
    Sergey Sagan
    0

    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

  • Sergey Sagan 5 posts 25 karma points
    Feb 19, 2014 @ 06:44
    Sergey Sagan
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft