Copied to clipboard

Flag this post as spam?

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


  • Marcin Zajkowski 112 posts 585 karma points MVP 7x c-trib
    May 25, 2015 @ 07:26
    Marcin Zajkowski
    0

    Umbraco Forms (Contour) + Hybrid Framework

    Hi all,

    at the beginning - great work with Hybrid Framework - kudos!

    We are trying to adopt it to some of our projects and now I am dealing with integrating Contour / Umbraco Forms on website build on top of Hybrid Framework. The problem is, of course, that model passing from forms is a RenderModel, but most of the pages is requiring MasterModel<T> as a model. I just want to know what is your "best practise" to get this working? For example if we still want to let editors choose a thank you page etc. but also navigate back to current page with form submitted.

    Thanks in advance for clarifying that.

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    May 26, 2015 @ 18:12
    Jeroen Breuer
    0

    Hello,

    If you let a page inherit from UmbracoTemplatePage it should also work:

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage

    So you pass your own custom model or don't change anything if you want. Some pages don't need the custom model.

    If it's not clear maybe you can give me some more examples of what you're trying to do. I don't have a lot of experience with Umbraco Forms (Contour).

    Jeroen

  • Marcin Zajkowski 112 posts 585 karma points MVP 7x c-trib
    May 26, 2015 @ 18:39
    Marcin Zajkowski
    101

    Thank you for your answer.

    From my little "investigation", problem is when editor / admin don't choose redirect page for contour form placed somewhere on website. Then Contour is from default passing a RenderModel to this page and of course this is breaking model declaration (if we have strongly-typed declaration for page without RenderModel usage). It seems to fix / avoid problem when we choose, even the same, page to redirect to after form submit.

    Second solution of course could be creating a custom workflow for Contour form or event posting form to some other page or the same page which could be handled by dedicated controller method. But this is much more "complicated" way.

    So, as a summary: when user / editor / admin want to place a Contour / Umbraco Forms form on page which has view with strongly-typed declaration from Hybrid Framework or anyone else which is not inheriting from RenderModel, it's suggested to manually point a destination page or action for form submission.

Please Sign in or register to post replies

Write your reply to:

Draft