Copied to clipboard

Flag this post as spam?

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


  • Umbrakko 9 posts 104 karma points
    Feb 06, 2018 @ 09:09
    Umbrakko
    0

    Umbraco Forms post to relative url

    How can I post the result (workflow) to a relative url? For example: /umbraco/surface/contactform/index

    I don't want to add the full url there to make it easier to migrate from test environment to production.

  • Umbrakko 9 posts 104 karma points
    Feb 06, 2018 @ 09:33
    Umbrakko
    2

    Solved it by overriding this code: https://gist.github.com/nul800sebastiaan/ce94b1b4d1bd0bf1fecb1ea82341d4c1

    and added the code below above UploadValues:

        if (!Url.Contains("://", StringComparison.OrdinalIgnoreCase))
                    {
                        var umbracoContext = UmbracoContext.Current;
                        var umbracoHelper = new UmbracoHelper(umbracoContext);
                        Url = (umbracoHelper.TypedContentAtRoot().FirstOrDefault().UrlWithDomain() + Url).Replace("//", "/");
                    }
    

    Make sure you modify the Guid too.

  • 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