Things to add to your theming toolbox in Drupal 8 development

WEB DEVELOPMENT | November 30, 2016

Drupal 8 is going to become the new norm in coming days. Drupal 8 has changed shape and appeal over time and risen with time with new and more powerful features. If the previous version is to be compared, Drupal 8 has come up with great improvements. You can see many alterations in front-end, in the theming system as well of this updated version. Let’s get familiar with Drupal themes.

There is no better framework when it comes to Drupal 8 theming and development. Below are some of the tools and ways that you can use for building a new Drupal 8 theme.

1. Devel Kint

Being a part of Devel module, Kint is great for finding out arrays that hold your field names, entity data, view modes and must more for Drupal 8. It is same as Devel Krumo especially for Drupal 8. It would actually work wonders in terms of theming for Drupal 8, particularly for scripting custom functions, developing theme hooks and variables.

2. Search Kint

Search Kint is for Drupal 8 what Search Krumo for Drupal 7. Going next to Kint, it offers two major added features that can work as a big time-saving component for the developers to rejoice. The first function that it adds is offering you a search box and helps you selecting the list to find any arrays on the page. Next one is to provide a box (get box) that allows you to copy any array path. It will help you stop doing any guess work as in this advanced version of Drupal the Kint is going to provide more data than what you have been accustomed to the Krumo of Drupal 7.

3. Twig Debugging

This has been the most major tools when it comes to Drupal 8 theme, hence it will actually work great for you when you are planning to create a custom theme for any website. This twig debugging tool will actually help you print:

  • Names of theme hook name
  • The complete path of the template you are using currently
  • All potential template names
  • All existing templates that are being used
  • One you have scripted your own custom theme hook, the debug result will also display all the new template names.

4. Drupal Template Helper

It is a Google Chrome plugin – Drupal Template Helper. It will switch all your Twig debug results to a web inspector tab of Chrome. Due to this, you can get a much cleaner main HTML inspection area and quite easy to scroll up and down. This extension is also found in Opera, which is mostly used by many developers for web development. As Opera is built on Webkit, which has the same Web Inspector User Interface as that of Chrome hence it is great for theming.

5. Drupal Console

It is fast gaining traction as the new favorites for developers. It is quite a great tool that is capable of performing several tasks in Drupal 8 especially when it comes to the terminal. It is a great addition for Drupal 8. This console can actually export and import config, create entities, wipe out the cache, develop theme, module, architect theme, develop nodes, etc. It is also equipped with a “learning” aspect also as an auto-complete feature. It is mostly doing all sort of things that Drush does has been doing but it also has some added features that are required. It will surely help and encourage many developers to switch to Drupal 8 leaving Drush.

This analysis is merely a small rundown of the Drupal 8 Toolbox. You may add much more making it a greater tool and framework to rely upon. Just try finding out your own favorite tools that you might like to add to this Drupal 8 which have not been listed on this roster!