Drupal 8 Basics #18 - Customizing Your Contact Form

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey what's up this is Scott with level up tutorials and in this video we're gonna take that contact form that was given to us when we installed Drupal and we're going to add an extra field and we're gonna show you what you can do to modify the display and the function of that form let's get going on that now so on our site we have our contact us form and with the Drupal 8 this just exists in previous versions of Drupal you'd have to install the module you'd have to create your own form but in this version of Drupal Drupal 8 we have a form here so what can this form do let's actually hover over this and we can see we just have the title and we don't necessarily have easy access to edit this but what we do have as an headed button up here so what do we do to get to this well let's come to structure and let's click on contact forms now we have a website feedback so let's go ahead and click Edit here if we want to change the name we can change the name from website feedback to something like contact us now it matches the page title we can have an auto reply where it can immediately send a user an email saying thank you for filling out this form we'll get back to you soon or something like that now recipients is where you add the emails that this goes to for instance this email is going to head to Scott talansky at gmail.com so it's gonna send right to meet it's gonna send an email right to me you couldn't have multiple emails just by specifying with the comma and we just have a wait and we have a make this the default form right now it is the default form let's click Save so we now have our contact us form but I'm not totally satisfied let's come back and click Edit now what we have here is we have manage fields manage form display and manage display click manage fields I want to go ahead and add a new field let's add a field let's just make this a text field so let's scroll down we can find text and it can be just a short plain text so we can just select text plane the label can just be him so this is gonna be somebody's name let's click Save and continue and maximum length sure we can't leave all this stuff as is so we now have the name field and we can make this a required field if you want you can click Save Settings now we have this name field if we head to our store let's actually just come to the home page back to site here let's come to contact us we can keep these both open at the same time so we can come back and forth you see we have email address subject message and name is way down here obviously we'd rather have the name be above the subject that way you can fill out the subject of this message who it's from and the message so let's come to manage fields we want to add manage form display here now this is going to allow us to drag these around so we can drag this up just beneath subject and we have send your email here we can make this visible and hidden we have sender name here we can make this visible or hidden let's go ahead and just make that hidden and the send copy to sender is all fine and if we save this you can now see when we refresh our contact page we now have your email address subject name message send yourself a copy if you'd like but basically we have this new field we chose where to go and now Drupal is just gonna sort of know what to do and it's going to throw that and format it into our email message accordingly so that's really nice in the past forms have always been a super huge pain in Drupal and now this having this built in this form manage forms it's nice and easy it's not the most robust form system we can't send multiple emails we can't use the value of an email the value of a select list to send to a different email or something like that they're still always going to be the need for more custom webform modules how this default solution is definitely a great solution for the default form settings it's not too complex and offers just enough functionality everything looks great and it's now ready for primetime in our website just like how we would want it so as always there's a scout level of tutorial so you have any questions or comments it becoming the video where me up at Twitter or Facebook at level up tutorials if you want to purchase the rest of these videos before they're released head over to store that level up tutorials calm or if you just want to help support the creation of free tutorials there's 800 some plus free tutorials at the time of recording this video and I'm upping your record 200 more this year so if you want to help support head over to Stuart I level up tutorials calm and spend some money I would really appreciate it thanks a lot for watching it Nelson next one right
Info
Channel: LevelUpTuts
Views: 16,266
Rating: 4.7701149 out of 5
Keywords: drupal, html, web developer, tutorial, css, javascript (programming language), drupal7, development, how to, drupal (software), series, drupal 8, modules, drupal8, composer, develop, developer, theming, tutorials, drupal video, drupal tutorial, web, web development (interest), website, web development, tuts, drupal theming, web application (industry), web application development (industry), web development (project), web developer (job title)
Id: CeMPqf8OoQM
Channel Id: undefined
Length: 5min 11sec (311 seconds)
Published: Mon May 16 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.