Copied to clipboard

Flag this post as spam?

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


  • Martin 278 posts 662 karma points
    Jan 21, 2016 @ 12:51
    Martin
    0

    Contact Form in Grid

    Hi all,

    Im trying to place a contact form into the grid. Its only a basic name & email fields, so I cant justify Umbraco Forms.

    Ive followed the tut over at aptitude and got it all working fine.

    https://www.aptitude.co.uk/videos/creating-a-contact-form-using-umbraco-mvc/

    My problem is that I would like to place the contact form in the grid, so that I can drop it in multiple pages.

    The contact form is placed in the page template like so.

    @using mySite.Models
    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    @{
        Layout = "Master.cshtml";
    }
    
    @Html.Partial("ContactForm", new ContactModel {ThankYouPage = Model.Content.GetPropertyValue<int>("thankYouPage")})
    

    Is there a way to embed the Html.Partial in the grid? Or can anyone help in how I would create either a macro or grid editor.

    Thanks

    Martin

  • Paul Seal 524 posts 2889 karma points MVP 6x c-trib
    Jan 21, 2016 @ 18:24
    Paul Seal
    100

    I would use a macro for this. Go to the developer tab. Go to Macro Partial Views, Create a new partial view tick yes to create a macro at the same time. Put your code in the view. It should work fine. If not, try using CurrentPage.thankYouPage for the id of the page you need.

    Delete the line that says Layout =

  • Martin 278 posts 662 karma points
    Jan 27, 2016 @ 09:20
    Martin
    0

    Thanks Paul.

Please Sign in or register to post replies

Write your reply to:

Draft