Copied to clipboard

Flag this post as spam?

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


  • Danny Blatant 91 posts 358 karma points
    Oct 13, 2014 @ 16:51
    Danny Blatant
    0

    Mixing UmbracoApiController and SurfaceController (plus non JS fallback)

    Hi guys,

    me again, I have a bit of Umbraco'esque theory here.

    I'm looking to build a carosel that affects the content of another view...

    Both the carosel and the content view are Partial View Macro's so the carousel and content view can be dropped onto the RTE freely.

    I have the Carousel working fine, using a Partial Macro View that calls an Action on a SurfaceController, custom Model and partial view. Lovely.

    Now, for the content area I would like to make this RESTful, so when a carousel option is selected the content is updated via AJAX. I have built my UmbracoApiController, with models and the PartialMacroView.

    The API works as expected, I can get my info via the /umbraco/API/Controller/Method url's. So I come to implimenting this on my PartialMacroView...

    What I would theoretically like to do is supply an Index ActionResult for the non Javascripters, and override this with the RESTful JS. However UmbracoApiControllr won't give me a view, and vice versa!

    Whats the best method for this? I have the PartialMacroView, but the Controller and Model are not exposed here... Likewise I have the Model and Controllr for the API, but no view...

    I guess the question's essence is, how can I retrieve the result from the ApiController from my PartialMacroView? Or how can I overload the PartialMacroView's Controller with my own (o I can load and query the API object as a seperate controller?

    Thanks,

    Danny "Blatant"

Please Sign in or register to post replies

Write your reply to:

Draft