Welcome Drupal 8 – a recap of DrupalCamp Vienna 2015 [part 2]

14 December 2015

Dit artikel is alleen beschikbaar in het Engels.

From the 27th till the 29th of November Max and Mike attended the Drupal Camp Vienna which was fully focused on new insights on Drupal 8. Since Info.nl is always looking towards new technologies and applications, it comes to no surprise that we would like to know as much as possible about Drupal 8 and later on to master our skills.

What makes Drupal 8 so different from Drupal 7?

The making of Drupal 8 has been going on for 5 years (!) so we already knew that a lot of things (not just technically) were going to be different. This is why most of the time Max and I split up to attend different sessions to cover as many topics as possible. Needless to say we learned a lot! Here is a recap of the sessions we followed.

This is the question that a lot, if not everyone had and still has. Not only developers need to be informed about this but it is also very important for clients. From a technical point of perspective Drupal 7 was outdated in the sense that it did not adapt or work with the latest technologies making it difficult for non-Drupal developers to work with it. It also had an impact for customers or content editors namely, performance speed and sometimes inflexible interfaces.

What Drupal 8 brings to table is things such as object oriented programming, Symfony 2 integration the twig engine and an improved interface which will improve experiences for both developers and customers alike.

From CMS to MVC?

Drupal was and will still be a content management system since clients will be able to easily manage their website. However what Drupal 7 was not using, unlike most of the PHP frameworks these days, were the things like routes and controllers. This will be in Drupal 8 though thanks to Symfony. Currently in Drupal 7 in order to create paths programmatically, hooks (hook_menu) are being used. This is something that is very confusing to non-Drupal developers and should not have been the case at all, since it leads to misuse of the hook_menu. At the camp we attended an introduction session concerning Symfony 3 (Please note that Symfony 3 is not officially released yet so is not included in the current version of Drupal 8). The lesson we learned from this session was to quickly dive into the learning of Symfony since it is essential to understand the structure and possibilities of Drupal 8.

Theming

If I had to pick a session I most enjoyed, it was the session at the end of the first day called “No more divitis” from MortenDK. In Drupal 7 there are a lot of issues concerning templating/styling for both front-ender and back-enders alike. Some well-known examples include the picture below, which shows that Drupal outputs too much html markup that is very, very hard to remove.

example

This is history in Drupal 8 thanks to the freedom in selecting a base theme for Drupal. Another issue in Drupal 7 is in order to render variables in template you need to use a function called Drupal render because it is not clear what data type you are using, which is especially confusing for front-enders. Back-enders struggled with all the hassle of specifying the data they needed or wanted to remove in theme functions and so on.
In Drupal 8 we have the twig engine which means that back-enders define the variable and front-enders can manipulate that variable in their template to their desires. Twig has standard functions (or you can make your own) which will easily allow a front-ender to display certain properties of a variable. So if a customer requests for another field in that variable it can be displayed without the front-ender having to go back to the template. Other functions include front-enders to include JavaScript only in the files that need them or the ability to remove all unwanted classes that contributed modules might sneak with them.

Another thing to notice is that most security issues in Drupal (33% in the Drupal core issues and 51.5 % in contributed modules) are Cross-site scripting (XSS) issues. The twig templating engine however auto escapes variables (this could be overwritten if wanted) so we expect to see a drop in security issues in Drupal 8, if used the right way.

And to sum it all up, both the front-enders and back-enders need to dive into the possibilities of and working with the new theming system. Needless to say we are very excited with the new theming system as it will allow us more flexibility and smarter coding.

DrupalCamp Vienna took place between 27 – 29 November 2015.
Check out part 1 – Welcome Drupal 8

Want to know more?