 Okay, so let's start. Thank you for coming and welcome to this session. Title is Web Form Versus Entity Form. Exposing forms to end users and I'm going to try to show and compare different ways to create forms to our visitors to enter their information and get feedback or information from them. Let me introduce myself first. My name is Pablo Lopez. I'm Lopez, both in Drupal.org and Twitter and I work for Drupal and when I'm not doing Drupal I used to play handle, so that's the plan. So let's go to start explaining what we are going to talk about in this session. We are going to talk about survey forms. Survey forms is kind of the concept of forms we create in our site to get extra information from the users, get feedback, contact forms. At the end is all the information we are getting from the external world to improve or give a better situation to our site. So we need to take into account that this information shouldn't be considered at website content. I mean, website content, as we can understand it, is the notes, views or whatever we want to show to the world. But survey forms we are getting information that it's from the world. So it's not theoretically thought to be shown at least how it is created. So different Drupal alternatives we have to create this kind of forms is of course used from API but there is a lot of stuff that has to be done so I think it's not worth to create a form API because it's a lot of work and we are in Drupal and we have modules for that to do that kind of work. Other thing we can do for this create a generic content type and try to expose that form for that content type to our end users but this is kind of risky because I said before this is not content and we are creating content types so notes can be published, notes can be interacted by other modules or appear in some listings that probably are not interested in. Also content types create new permissions, new options so we are going to create a lot of things around the form that we are not interested to have. Other option is to try to embed external system but you can embed in an eFrame Google Docs format that's not elegant, we are creating something professional. There are also modules that try to integrate external tools and synchronize their survey results like a limb survey sync module and also have survey form modules. These are the kind of modules we are interested the kind of modules we are going to talk in this session so let's describe them in more detail so survey form modules are modules that allow to create multiple survey forms in our site and also they allow to store the results to be processed after that. I mean, processed we can create analytics, we can export the data, we can do a lot of things and processing to get what we want with that data. Also give support for notification to our end users and access control, with access control I mean the number of times that someone can submit the form their roles that are allowed to access to the form all of that should be support in an easy way configurable way and not creating a lot of permissions and all that stuff as I commented with the content type approach. So we have different options for this but there are two big players in this game. These players are Webform and entity form and those are the modules I'm going to show you and compare along the session. So let's start with Webform. Webform is an old friend in the Drupal world it was created in 2004, we have hundreds of thousands of installations of this module, tons of releases. So this module also have a lot of feedback from the community and it has been improving more and more along the time and it has been the factor standard for maybe a lot of sites in Drupal 6 and Drupal 7 I think probably people when asked for a form they directly install the module and then ask it for how the form should be done because it's a great module and I think almost everyone has used it in the past. The key features about the module is that it's a specific survey form to build on top of Drupal. So it's kind of not using the entity API it's not using all that stuff because it creates their own database schema to improve the scalability and has of course the built-in support for the most useful tasks we need to do with survey forms. One of the things and the most interesting things around the web form module is that it creates the form. On top of Drupal node it creates the web form content types and also have hundreds of other modules. There is a huge ecosystem of modules around web form that integrates them with a lot of systems like rules, like features and so on. If we have a quick look to the web form UI we have something similar to the node. It's a node itself so we have the view and edit tab and we have two new tabs, the form tab and the result tab where you can create in the first one the form itself and configure the main things and the emails to notificate and so on. And the second one is where you see the list of the submissions that you can process, get the analytics, download them in Excel file directly or even clear the data. That's something built on top of the node page. Entity form is a modern one, it was created in 2011 and it has a good number of installation but it's much more smaller than web form because it's only 15K installation but it was created for Drupal 8 and thinking in the Drupal 8 architecture so it's created with all the subsystem it's using entity API, in fact it's an entity. So the features is that it's integrated with entity staff but it requires to have some experience with the Drupal UI because it's not so intuitive like web form and also requires some other modules for the usual task, for instance it requires views to prepare the data and so on. But on the other hand, it's really easy to integrate with almost everything in Drupal because it was thought to be part of Drupal not something built on top of Drupal. And if we have the UI, it's very similar to the for instance the content type or any other entity UI. In fact, it's reusing the Manas Fields tab to create the form itself and add two new tabs like the form submission where it's just a couple of leads is much simpler than the other one but it also works. So we know what are we talking about, we are talking about forms, we are talking about these two modules, we now have both modules, so let's compare them. I divided this comparison in seven blocks depending on the main features and let's go there. So the first one is about the storage and scalability of these modules and the forms created by them. As I said before, web form module creates its own table and all the data is stored in a single table in the database and entity form is reusing the entity system. As you know, the fields in the created are spread along the database, its field creates a new database table, it's kind of different stuff. So we can have scalability problems in case we have a huge number of items or four or a huge number of forms in the same site. If we are talking about the storage and scalability, web form is a better solution than entity form. If we move to the form creation options, we know that web form is attached to a node while entity form creates its own page but as you can see web form has almost all this stuff built in by default because it's a specific tool for cyber phones so you can get submission access, submission limit, the draft support, availability as block. While we need something else for entity form, we need some country module to get the block support but mainly we can do all everything with both so it's something easier to do with web form but entity form could work too. Moving to the next one, probably one of the keys is the form fields. So entity form as it's based on field API, you can reuse any field type and any module providing a field we have in our Drupal sites like we can have geo fields, we can have complex address fields and are built in by default in the entity form stack while web form provides just nine form field types by default but as I said before we have a lot of country modules providing new features but it's kind of difficult because if you want to work with addresses, you have the other field in your site to work with your fields, you have also the kind of country module on top of web form so it's kind of the application stuff here but we have other stuff interesting for forms like the multi-page conditional fields or grouping fields that of course are built in by default in web form but you can do it of course with some country stuff in entity form like field groups or multi-page is different options but you can get again almost done with this. About the survey features is something similar well survey features are the specific stuff we create for surveys like the download and process the data and the notifications for users are we have a basic not basic but limited built-in support in web form but you can integrate entity form easily with some country modules like views, rules or view data export to get the same stuff so or even more flexible because you can use views you can integrate all of them so you can try to join complex data while the data exporting web form it just download the results so it's more flexible but you need to configure your own views and something similar for the charts you can create fancy charts with the results but we need to work in both cases because are not integrated by default in any of the modules and about theming when I talk about theming I'm talking about how to create the markup I'm not talking about CSS because both modules can edit the CSS of course with the theming stuff but one of the important thing is the template suggestions it's built in using some kind of a templating name in web form but in entity form we need to create some kind of custom code, we need to create some hooks to try to implement this so it's easy for us who are site builders to do it easily with need to write any code in web form panel integration is another interesting stuff that we want to show it in a pane we need entity form pane so the entity form block for the entity form module but it's built in by default in the web form module but other interesting stuff is if you want to create complex markups moving around all the fields or you want to present the same form in a different way with different layouts it's not possible with web form because for the panel integration the form is treated like a whole so it's a component itself and you can place it but it's the whole component the entity form one you can split and you can put any field in a different place or in a different order depending on our pane so I think it's much more flexible in this way I thought if you want to hard code the templating it's better to use the web form one and talking about integration with other system of course we already said it before entity form was created thinking in Drupal 7 thinking in entities so has built in support to be integrated with almost everything we have in Drupal while we need some kind of stuff with web form entity API is not currently supported fully but builds have some kind of support but it's complicated you have to create some custom relationships to prepare the views the features stuff to be deployed is there is some kind of module but you can have some problems because the idea and the philosophy of the module itself and one important thing is multi-lingual you are creating a multi-lingual site and entity form we have the default support for multi-lingual using the internationalization module so you can just translate it as we translate any other thing in Drupal with the standard procedure while web form requires the web for localization module like it's kind of a module that provides some different UI different way to treat the form so it's kind of difficult or need some learning if you are familiar with the standard Drupal way to do the things and about deployment usually we need to deploy or we want to synchronize our data in our site web form was created 11 years ago and it's kind of old module when all that stuff of export configuration and all this was not yet available for all of us in Drupal so it was thought that something dynamic it's attached to a node so you can create a node that it's content usually we don't export the content itself so we don't have by default the idea to export and deploy the web form stuff while entity form is created as an entity so we can export like other content type or any other entity type so it's easy and we can do it in a kind of a standard way about the target user for each module web form was created thinking in end users it created own UI for the forms and tries to make it as easy as possible for everyone who is not familiar with the Drupal UI and try to standardize and using modules like form builder and so on it provides an easy drag and drop UI to create the forms while the entity form we need to be familiar with the field API stuff and to configure all the variables in a field so it's more indicated for kind of admin users or people who has some knowledge of how Drupal works so the built-in deployment is not supported in web form but it is in entity form as we have seen but about the deploy strategies here entity form can be deployed easily with features while web form has a different strategies we have the features strategy using the web form UUID module but it's not working sometimes it needs to be a specific stuff you need to configure it in a specific way so it needs some work or using that kind of external stuff like you can create a node export module you can export your web form your web form in your local or your dev environment and then go to your production environment and import that node but it's kind of you can also have the typical problems with the node IDs and so on so web form is not designed for that so to recap this comparison you have seen that there is no golden hammer solution for all the situations so depending on our requirement depending on the situation it's better to use a different approach or not we have seen that we can do almost everything with both modules depending on one thing or not we need some country modules or we need another but we can do almost everything in both cases but the differences web form is a specific tool built on top of Drupal while entity foreign adapting the entity API and providing all the power and all the strength of entity API to create survey form for on their users here in Drupal so we need to study we need to read carefully our Poyer requirements before to make decisions about what is the best tool to use in our site so we can just okay I'm an entity fan I love features and let's go to install entity form and then you have form you have 2,000 of forms in your site and the form has 200 of fields so you are going to break your site because you are going to hit performance a lot on the other hand if you want something that is going to be deployed something that is going to be a small something that is going to be standardized probably web form could give you some problems because of the things we talked about so to make easier these decisions I created a list of helpful questions that I think that are interesting to ask ourselves before to make that decision so we can ask ourselves about the number of forms about the number of fields performed about multilingual stuff is going to be our site multilingual or not and the user's experience with Drupal from the people who is going to edit and create the forms the types of fields we are going to use because it's not the same if we are going to use just a couple of fields we are going to create text fields and selects and radio buttons so we are going to need complex things like I don't know like others fields or even creator custom fields here to our form and also the grouping experience how we are going to deal with the submissions what we are going to do with them on the notification logic there is the dynamic, the theming, the deployment there is a lot of things we have to take into account when we create our forms and it's interesting to ask ourselves all these questions before to make the decision so I created a couple of examples to see how we can do it for us so the first example is a course feedback site where we allow people to log in in your site create their user and create courses and with a description and then create a form we don't have any limitation about the form it can be how they want and we are going to allow just to submit once the form per user and we are going to just notify to the site owner who someone has filled the form and just allow to download to the creator of the survey all the results in an Excel file so we ask ourselves all the questions we can see that entity form could then be a good option because of the scalability we can have a lot of forms in our site we don't know how many fields we are going to have in its form also the user experience we need to talk about that because it's going to be used by end users so we don't know if they are familiar with all the Drupal UI and how Drupal works the multi-page support is better in the web form than entity form and also the data extraction is simpler built in there and dynamically of the form because they are going to be moved and used by users and we don't know how often they are going to modify the forms and the questions and also the specific replacement because we are going to show the form behind the description it just don't by default in web form while in entity form we need to create the node we need to create the form and we need to figure out the way to put both together in a single page so in this case web form wins but we have a second example where it's a job application for a big site we are working with a big company with a lot of countries it's multi-lingual and have tons of users but we don't know just a form it's just a submission form we have some kind of other fields but we need just one form but we need to place it in different ways and with different layouts so in this case we don't have problems with scalability because we are not going to have a lot of items and we are not going to have a lot of forms but we can have problems with multi-lingual in web form because it's not using the standard way or the field types because if we are going to use other fields or complex stuff we are not going to be support by web form way we can do it easily with entity form but also we have some kind of problem with the notifications in my opinion we can't notify to all the user with a 13-roll and living in the same country that the user who submit the form so that kind of complex logic can be done with web form and it's easy to implement with rules if we are working with entity form and the same about the placement of the form because we can use panels or other options to create different layouts to show in different ways in different parts of the page so in this second case entity form wins so depending on the situation we have to take into account all the concepts and go there and make the best decision so now it's your turn now it's your turn to decide what's your best tool for you in any case because there is nothing right on a stone here so let's talk a bit about Drupal 8 and how is the future of these forms in Drupal 8 and moving to the web form stuff it's kind of not chaotic but different like in Drupal 7 because there is a new team of maintainers Nate Hoge who was in the Drupal, leading the Drupal 7 web form now moved to a backdrop and is not working in Drupal 8 anymore and web form is a tool is using their own UI so need to redesign, need to rewrite a lot of stuff because almost everything has to be done from scratch for Drupal 8 they have the idea, they have the architecture but almost all the code have to be rewritten again and we have again a problem with the country modules having a lot of country modules around web form is great in Drupal 7 you can integrate, you have tons of extensions you can do almost everything using that country modules but for Drupal 8 we have two problems the first one is that we need first to have web form working in Drupal 8 to be able to update and to port all those modules and the second one is that we need that maintainers will be able and will be interested in porting those modules to Drupal 8 because sometimes people create a module because they need it, sure but it's not interested in maintaining it anymore or just because there is a huge number of people using that module and it's not so easy to port to Drupal 8 so I don't know exactly how web form will be ready for Drupal 8 but there's people working on that but to have all the functionalities to have all the contrib stuff and all the availability we have in Drupal 7 we will need probably a long time on the other hand with entity form it's a different situation well entity form has been renamed for Drupal 8 it's going to be e-form because we have some kind of naming issues with the entity form name space and the same people who created the module is still maintaining it Bonban is going to take the responsibility of porting the module to Drupal 8 but we need to move the module to a Drupal 8 architecture but it's much easier I think that the web form situation because entity form is reusing all the entity architecture entity form is reusing all the entity UI entity form is using modules like that were in the past the country modules like views or the entity API module that now are in Drupal core so we already can work on top of that to create the module and to try to evolve so and also helpful modules like rules or field group that are kind of required to be used in Drupal 7 to have a full experience with entity form are generic modules that almost everyone is using in Drupal side so there is a huge community wanting to have all those modules ported people who is maintaining those modules is already working on Drupal 8 and is having some advance there so all the things are making that e-form module will be ready for Drupal 8 I think soon probably in the next weeks they have the first working beta of the entity form module for Drupal 8 so if you want to work on this in e-form web form or any other stuff you can attend to sprints on Friday I encourage you to attend to sprints to learn and to help with Drupal and here final is a list of interesting resources to if you want to give a deep research on this you have the web form project the entity form project links to different sessions about the web form in Drupal con documentation another post about the comparison of these two modules so I think that's something interesting you can use it as you want so now it's time for questions oh yeah so I started to use entity forms because I couldn't find a solution for web form that is similar to field collections do you know a country for web form that does this I found some attempts but they were really limited no, I don't know any alternative field collection for web form welcome I also have a quick use case question for web form in web form you can specify the amount of submissions you get for the entire form but is there an add on or a solution to specify that if a certain answer has been given a certain amount of times then that question becomes disabled or something I understand no, in entity form it's built by defaulting in web form you have the time window when you give the options for the number of submissions but in entity form I think you can create it with rules but that's the amount of submissions for the entire form that you mean right? sorry, is that the total amount of submissions for the entire form that you were talking about in entity form but my question is specifically within web form or any form for a certain question so you have a question with radio boxes and if like let's say five times the answer A has been given can you disable that option from the question in web form? disable that option well, by default it's kind of a complex situation so I think that's not possible with web form you can use the hooks provided by web form and we just submit the form try to make the logic and then disable it programmatically but I think probably that's one or you could use the web form rules module and create a rule that checks the number of times that option has been selected and if it's reached set the web form status to third and unpublish it okay, thanks welcome answer your question there's a module called web form multiple and you can use it in conjunction with the feed sets and then you have some kind of feed collection you can use multiple times no more questions so thank you