Copied to clipboard

Flag this post as spam?

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

  • Ian Gerdes 10 posts 81 karma points
    Aug 19, 2016 @ 10:59
    Ian Gerdes

    render form on all pages

    morning Nicholas

    i have a newsletter form which i want to display on all pages on the footer. is there an easy way to do that? i have included the file that renders the form on the footer which renders fine when i pick it on a page.

    @{ Html.RenderPartial("umbformulateFooter"); }

        @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
        // Get a view model for the picked form.
        var pickedForm = Model.Content.GetPropertyValue<ConfiguredFormInfo>("formPickerFooter");
        var vm = formulate.api.Rendering.GetFormViewModel(pickedForm.FormId, pickedForm.LayoutId,
            <div ng-controller="formWrapper">
            <!-- Display the form. -->
            <div ng-if="status !== 'success'">
                <div class="">
       @if (pickedForm != null && pickedForm.FormId != null)
        @Html.Partial("~/Views/Partials/Formulate/RenderForm.cshtml", vm)
            <!-- Display the success message. -->
            <div ng-if="status === 'success'">
                Your request has been received!
            <!-- Display the error message. -->
            <div ng-if="status === 'failure'">
                Unable to submit request. Please try again.
  • Nicholas Westby 2054 posts 7100 karma points c-trib
    Aug 19, 2016 @ 13:55
    Nicholas Westby

    I suppose the easiest way would be to pick the form from a property on the homepage, then get that value from all other pages. Would look something like this:

    var pickedForm = Model.Content
        // Get homepage.
        // Get form from homepage property.
  • Ian Gerdes 10 posts 81 karma points
    Aug 19, 2016 @ 14:54
    Ian Gerdes

    cheers simple really!

Please Sign in or register to post replies

Write your reply to: