Copied to clipboard

Flag this post as spam?

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


  • Jeavon Leopold 3008 posts 13221 karma points MVP 7x admin c-trib
    Dec 11, 2014 @ 12:35
    Jeavon Leopold
    1

    Umbraco Forms v4 - Custom rendering issue

    We are having trouble getting Umbraco Forms to use our custom views.

    In our view we have the following:

    @{
        Html.RenderAction("Render", "UmbracoForms", new { formId = "e6b9d634-d2d1-4281-b79d-477b81cd5752", mode = "script", View = "HomeContact.cshtml" });   
    }
    

    Which renders /Views/Partials/Forms/HomeContact.cshtml, great!

    We have also created /Views/Partials/Forms/e6b9d634-d2d1-4281-b79d-477b81cd5752/Script.cshtml

    But FormViewResolver.GetScriptView(Model.FormId); does not return this custom path, it is returning /Views/Partials/Forms/Script.cshtml

    Have we missed something?

    Thanks!

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Dec 11, 2014 @ 14:02
    Tim Geyssens
    2

    Hmm looks like we have an additional forms directory so try

    /Views/Partials/Forms/Forms/e6b9d634-d2d1-4281-b79d-477b81cd5752/Script.cshtml

    We'll update so that extra folder isn't needed

  • Jeavon Leopold 3008 posts 13221 karma points MVP 7x admin c-trib
    Dec 11, 2014 @ 16:01
    Jeavon Leopold
    0

    Ah cool, yeah /Views/Partials/Forms/Forms/GUID/ works!

    Thanks!

  • Dan 1250 posts 3747 karma points admin c-trib
    Feb 24, 2015 @ 15:17
    Dan
    0

    I can confirm this is still an issue in Umbraco Forms 4.0.1.

    It seems like the form rendering and the script rendering should be made consistent, as currently I think the form is always rendered as the default 'Form.cshtml' view unless a path is passed to the RenderAction to tell it otherwise, whereas scripts seem to check if a guid-named folder exists - in which case they render that unless a custom path is passed in, in which case it requires the nested 'Forms' folder. It's all a bit confusing.

    I'm not 100% certain on the above, but something's definitely awry :)

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies