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
@using formulate.app.Types
@{
// 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,
pickedForm.TemplateId);
}
<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)
}
</div>
</div>
<!-- Display the success message. -->
<div ng-if="status === 'success'">
Your request has been received!
</div>
<!-- Display the error message. -->
<div ng-if="status === 'failure'">
Unable to submit request. Please try again.
</div>
</div>
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.
.AncestorOrSelf(1)
// Get form from homepage property.
.GetPropertyValue<ConfiguredFormInfo>("formPickerFooter");
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"); }
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:
cheers simple really!
is working on a reply...