Faichi Solutions The Changing Face of Drupal with Drupal 8 Whitepaper published on Dec. 17, 2014 Compiled & Written by: Team Drupal, Faichi Edited by: Payal Mathur, Communication Manager, Faichi CONTENTS EXECUTIVE SUMMARY... 2 DRUPAL AN INTRODUCTION... 2 DRUPAL 8 AN OVERVIEW... 3 CHANGES IN CONTENT MANAGEMENT AREA... 5 SITE BUILDING - NEW FEATURES... 8 DEVELOPMENT NEW FEATURES... 10 Whitepaper- Drupal 8 Page 1 of 12
1. EXECUTIVE SUMMARY In the midst of multiple content management systems, Drupal is certainly gaining worldwide attention because it is very powerful when tamed. From the great SEO features to the glorified Views module to the enthusiastic and loyal community, it is indeed one of the best open-source website frameworks available in the market. Although Drupal started as a simple PHP-based message-board project, it first gained popularity in 2003. Since then, Drupal-based websites have quickly grown to account for nearly 2.1% of the current websites worldwide. Drupal was traditionally adopted because of its powerful customization tools and fantastic organization. Subsequently, with the constant changes and upgradation, several features came straight out of the box like blogs, polls, user profiles, RSS feeds, comments, advanced search, Open Id support, etc., making it a great content management system for varied websites. One of the major reasons behind Drupal s success is that its community of developers always looked for big, forward-looking changes to make it more relevant and useful with time. For instance, Drupal 7 was a fantastic CMS, but because of various limitations like less supportive on mobile side, no ability for having a layered structure, etc., the Drupal 8 team decided to overcome the existing challenges in Drupal 8 by driving it towards the best enterprise solution. This white paper talks about how the significant changes in Drupal 8 will impact the CMS landscape in the years to come. 2. DRUPAL AN INTRODUCTION Drupal is a second generation CMS where customized or new functionality can be created in the user interface without programming, thereby reducing your dependency on service providers and offering the freedom to make simple adjustments and development yourself. It is an open-source web development platform for user communities and online content. Using Drupal, you can develop solutions that: Offer manageable maintenance Offer less time to market Help in empowering your staff Help in lowering the total cost of ownership Whitepaper- Drupal 8 Page 2 of 12
A recent survey reveals interesting statistics of how Drupal is gaining pace in the CMS landscape: Out of top 100,000 sites, over 70% are built in Drupal and Wordpress, clearly suggesting that majority of developers are now relying on these frameworks for building their most popular websites. The strength of Drupal comes from its community. The Drupal community follows a policy in which it supports the previous release and the current release for any critical security updates and bug fixes. 3. DRUPAL 8 AN OVERVIEW Drupal 8 is all set to establish a new standard of content presentation and user-friendliness, while offering several new ways to deploy and tailor your content to the web. Its backend is powered by Symfony 2, which is a much faster and lighter core with tons of streams for themes and modules. This object-oriented application framework provides the following benefits: Higher efficiency and performance Easy maintenance of Drupal Core as the custom code is reduced Better multi-lingual support Partial caching of pages Whitepaper- Drupal 8 Page 3 of 12
Drupal 8 is the one of the major releases in the last four years, bringing over 200 new improvements and features, including in-place editing, a mobile-first approach and improved accessibility. The following graphic summarizes its key features: This version is not yet ready for production deployment and is still in the development phase. The current Drupal 8 release is Beta 3. 2007 Drupal 5 2008 Drupal 6 2011 Drupal 7 2014 Drupal 8??? Every developer would be curious to know- Do I have to re-learn all the things that I have already learned about Drupal? The typical answer to this is YES and NO. Since Drupal is for the web, and the web is always improving and evolving, therefore, the new improved things in Drupal 8 would have to be learned, but the knowledge of Drupal 7 would remain as is, whereas the new way of implementation needs to be learned. Whitepaper- Drupal 8 Page 4 of 12
In case your site is currently running on Drupal 7, you can breathe easy and slowly progress towards the transition as the community will continue to support Drupal 7 until Drupal 9 is released. The following graph depicts the statistics of millions of sites that are currently running on Drupal 7 core. 4. CHANGES IN CONTENT MANAGEMENT AREA Drupal 8 has tons of new features in store for both builders as well as developers. In Drupal 7 and below, content was saved to the database; making deploying configuration changes from one environment to another a very tricky affair. The basic workflow after making content and configuration changes to your Drupal 8 site is: Some of the interesting changes in the content management area are as follows: New content form: The lengthy content form in Drupal 8 is now trimmed to a very short form with options moved to right side, making it easier to update/add content. In addition to this, the body has now a WYSIWYG editing. Whitepaper- Drupal 8 Page 5 of 12
Internationalization Improvements: Since Drupal is used worldwide, hence, to achieve Drupal 7 site in various languages is a challenging task. This has been made a lot easier in Drupal 8 with its core and comparatively very few modules. Accessibility improvements: Drupal 8 core provides the accessibility feature in whatever text you set within such an element, it will be read by the screen reader. This feature comes very handy in specific sites, especially government sites. On Page Help Tours: This is one of the drastic changes in Drupal help section as earlier when clicked on Drupal Help, it used to navigate to a static page. On this page, one faced difficulty in finding what they actually required. In the new feature, the help page pop-ups help you navigate to the flow of actions required for a particular form. This is mainly used by many companies like Apple, etc. For example, if you have to add a view, (as in the image below) it would give you 10 steps with a guided tour of how to create a view and what all is required. Whitepaper- Drupal 8 Page 6 of 12
Integration of CKEditor in core: CKEditor helps in WYSIWYG editing, while adding or editing the content. New inline / On Page Content Editing: In Drupal 8 Core, if you are viewing the page on the view page, you can simultaneously edit the page with a WYSIWYG editor, making it easier to see what the content would look like, while you are on the same page. Whitepaper- Drupal 8 Page 7 of 12
5. SITE BUILDING - NEW FEATURES Drupal 8 has introduced the following new site building features for developers: The views are added as a part of Drupal Core. New fields like date, link, email, telephone, etc. are added to the core. Mobile first Completely default responsive Changes in blocks Configuration management REST services Views: With Views becoming the part of core, it has tremendously increased its power to build the entire application. Using Views, you can get the content directly from the database to present it to the user as a required content type. It is like an interface for you to build a SQL query. Views can also be used to present the related content. For example, you can display a list of users along with the links to the content they have created. https://www.drupal.org/project/views Field Types: Certain fields like telephone, date, etc. are now a part of the core module so that you do not have to use the date module going forward in Drupal 8. This feature also helps in adding dates to your content. Completely (100%) Responsive: Most of the sites make their themes responsive, but most of them do not have the responsive Admin pages, which makes it difficult for site administrators to make changes to the site when using mobile devices like phones and tabs. However, with D8, the admin pages are also responsive, so that you can make changes to the site when on the phone as well. Whitepaper- Drupal 8 Page 8 of 12
Form Display UI: This new feature will help developers reduce the writing hooks for form display. Now, you have a UI, which will help you control the fields within the form, display of forms, the sequence, etc. Blocks: Drupal 8 has eliminated the need to use the block module as blocks are now part of the core. They are typically the boxes of content, which can be made to appear in the required regions on a Drupal site. D8 gives you the facility to create a custom block and use it in one or more places. https://www.drupal.org/documentation/blocks Whitepaper- Drupal 8 Page 9 of 12
REST Web Services: With the inbuilt REST web services in Drupal 8, everything now is an entity and, thus, can be exposed through a rest service in the form of XML/JSON, etc. This helps in making the external system integration very easy and gives Drupal 8 more power to integrate with the enterprise applications. People Menu is more user friendly: In Drupal 8, the users can be filtered with the email, name, role, etc.., making it very easy to find users in this version as compared to the earlier versions. Entity Reference: With entity reference, it is now easy to refer any field of type entity reference to virtually anything on the site i.e. you can refer a block, a user profile within a block, etc. 6. DEVELOPMENT NEW FEATURES Drupal 8 new development features are: Symfony based Object Oriented Architecture Change in routing system Changes in configuration management External components used Migrate Module in CORE Normalized, completed API s Symfony based Object Oriented Architecture: Conceptually, Drupal 8 still remains the same, but what has changed is the way of implementation in certain areas. The changes for Drupal 8 stand to adopt modern open standards and PHP concepts, making it more developer friendly and modern. Routing System in Drupal 8: This routing system replaces the routing parts of hook_menu(). A route is a path defined for Drupal to reach a page. In Drupal 8, you need not use hook_menu, and use YML file instead. The simplest way to define a route in your module is to include YML file, naming it based Whitepaper- Drupal 8 Page 10 of 12
on your module, e.g., sample.routing.yml, defining how Drupal will behave when a specific path is encountered. https://www.drupal.org/developing/api/8/routing YML is an industry standard way of describing objects, designed to be easily mapped to the data types common to the most high-level languages like Java, etc. Sample of a YML file: sample.content: path: '/admin/config/content/test' defaults: _controller: '\Drupal\sample\Controller\SampleController::content' _title: 'Hello World' requirements: _permission: 'access content' Changes in configuration management: Drupal 8 has considerably changed configuration management as anyone using the features earlier had to use it for deploying the changes to production, but now it is not required. In Drupal 8, every configuration is now managed by Drupal s configuration management system. Now, you can fully export the site configurations and a zip file with a few YML files would be created for configurations. Just import them, check them in GIT and your deployment is done. External Components used in Drupal 8: Following are the external components: 1. Symfony2 2. Twig 3. Composer 4. EasyPDF 5. CKEditor 6. PHPUnit 7. YMAL 8. jquery UI Migrate in CORE: It is important to have Drupal 6 migrated to Drupal 8 and also Drupal 7 to Drupal 8. Migrate Module - https://www.drupal.org/node/1528934 Whitepaper- Drupal 8 Page 11 of 12
https://www.drupal.org/node/2150405 API Improvements in Drupal 8: $node->field_foo[language_none][0][ value ] In Drupal 7 and earlier, we have been using similar kinds of functions for fetching values from nodes for particular fields etc. Now in Drupal 8, you have to just use - $node->field_foo->value. Blocks hook_block_info hook_block_configure hook_block_save hook_block_view Caching: Now in Drupal 8, you can give all the details for the blocks in just one file BlockPluginInterface - Defines the required interface for all block plugins. All block configurations can be specified for the block. Cache_get_object() Cache_get() Cache_getmultiple() Cache_set() Cache_ckear_all() Cache_is_empty() In Drupal 8 its only \Drupal::cache() This handles all the different caches. https://api.drupal.org/api/drupal/core!modules!system!core.api.php/group/cache/8 DRUPAL 8 API Reference - https://api.drupal.org/api/drupal/8 Faichi Solutions specializes in building end to end solutions for Enterprise portals using Drupal CMS. If you have a similar project in mind for Drupal Development, QA or Support. Please get in touch with us at sales@faichi.com or call us on +1 (408) 769-4941. To know more about our services, please visit www.faichi.com USA India Faichi Solutions, LLC Faichi Solutions Pvt. Ltd. Office No. 230 504, Accord IT Park, Baner Road 640 West California Avenue Pune, Maharashtra 411045 Sunnyvale, CA 94086 Whitepaper- Drupal 8 Page 12 of 12