Google News
logo
Drupal Interview Questions
Drupal is a Content Management System (CMS).  It’s an open source content and free CMS framework written in PHP.  Drupal is distributed under GNU General Public License.
 
Drupal is a framework which organize, manage and publish content easily and provides a lot of features of customization.
Using content construction kit Drupal allows you to create multiple content types without any programming skills. And for each content type it allows customize theme template. You can have an article, story, slideshow, content type and so on.
There are two key features of Drupal
 
Upload Module : It enables users to attach different types of files to node types of your liking.

Embedding : It enables to embed media within nodes that are hosted on your websites.
Following are some most commonly used PHP based CMS :

* Drupal
* Joomla
* WordPress
* TYPO3
Through caching Drupal allows to speed up website using different configuration like page caching, block caching and lifetime for cached pages.
 
Page Caching :  It enables the entire HTML of each page to be stored in the database.  It reduces the amount of queries needed

Block Caching : 
You can set the cache setting for a block in views, when block created by views

Minimum cache lifetime : 
It is the amount of time before the page cache is cleared. On each cron run, page caches are cleared.

Expiration of cached pages :
It only applies for an external mechanism, for example, your browser cache or varnish
Drupal is very powerful and can be used for building large, complex sites. It is PHP based template and allows non-technical users to add and edit the content without any HTML or Web design knowledge. Using Drupal CMS, it can be easy to interact with other sites or technologies and can handle complex forms and workflows. It is available with more than 16000 modules which can be addressed with Drupal core and add-on modules.
The Features of Drupal are :
 
* It makes easy to create and manage your site.
* Translates anything in the system with built-in user interfaces.
 
It connects your website to other sites and services using feeds, search engine connection capabilities etc.

* Drupal is open source software hence requires no licensing costs.
* It designs highly flexible, creative website to the users and display more effectively to increase the visitors.
* Drupal can publish your content on social media such as Twitter, Facebook and other social mediums.
The disadvantage of Drupal are :
 
* Drupal is not user friendly interface. It requires advanced knowledge and few basic things about the platform to install and modify.
 
* Drupal is new content management system. It is not compatible with other software.
 
* Performance is low compared to other CMS's. The website which is built using Drupal will generate big server loads and never opens with a slow internet connection.
Menus are very important to navigate your website easily. Menus offer a set of links as a result; you can navigate your website. The Drupal menu allows you to add, remove and rename the menus and menu items.
A patch is a file that contains a list of differences between one set of files, and another.  Through patches, all the changes in code like additions or deletions to Drupal core can be made. Also, patches can be used to make changes to another copy of the original or main file.
PDO means PHP Data Object; it is a lean and consistent way to access databases. It allows developers to write portable code with ease.
In a database Drupal stores information, and each information has its own database table.  For example : the basic information regarding the nodes of your site are stored and kept in the node table, and if you use the CCK module to add fields to your nodes, the field information is stored in a separate table.
Modules are like plugin for your site.  It allows you to add different functions to your site such as polls, contact forms and search fields.  Some of the modules recommended are
 
* Views
* Token
* Ctools
* Quicktabs
* Pathauto
A module is a set of codes that extend Drupal features and functionality.
 
Drupal modules :
 
Core modules : These modules are included with the main download of Drupal, and you can turn on their functionality without installing additional software.
 
Contributed modules : These modules are downloaded from the Modules download section of drupal.org, and installed within your Drupal installation.
 
You can also create your own module "CustomModules" using PHP programming, and Drupal's module API.
It is a very useful tool as it helps you perform various admin tasks using one or two commands in the terminal, replacing the need for many clicks and page refreshes in the UI. "DRUSH" is an awesome shell interface for managing Drupal right from our cloud server using command line.
Some of the SEO modules available in Drupal are :
 
* Pathauto
* Meta tags/ Node words
* Service Links
* Google Analytics
* Related Links
* Search 404
* Site map
* Url list
The term Drupal weight is used to describe the priority or order in which the function is processed, or block/ node is displayed.
 
A heavier (+10) weights will appear lower in lists while a lower weight (-10) will float to the top of lists.
Drupal stores its information in the database like individual pages, registered users and so on.  For your Drupal site, database forms the back end; it supports MySQL /MariaDB, PostgreSQL and in Drupal 7, SQLite.
Render arrays are the basic building blocks in Drupal. They provide you a structured way to programmatically change the content before it is displayed.
Distributions are full copies of Drupal including Drupal core along with additional software such as modules, libraries and installation profiles.
 
Distributions are used for :
 
* Demoing Drupal
* Evaluating Drupal
* Quickly binding Site
* Learning Drupal
The term cron is a daemon that executes commands at specified interval. Drupal cron executes commands or scripts automatically at specified interval.
Languages in which Drupal can be translated are :
 
* Catalan
* Dutch
* French
* Hungarian
The field API allows custom data fields to be attached to Drupal entities. Any entity type can use field API to make itself "fieldable" means allows fields to attach to it.
Drupal consists of multiple layers for execution. Hence, caching is a vital aspect of Drupal to measure performance accurately.
 
Here are the various ways of caching in Drupal :
 
* DRUPAL INTERNAL CACHING
* CUSTOM CACHE USING DRUPAL’S CACHE API
* DRUPAL VIEWS CACHE:
* MEMCACHE
* OPCODE CACHE
* REVERSE PROXY - VARNISH
* BOOST Caching
* Using Content Delivery Networks(CDN)
Drupal treats all the stored content on its web site as nodes. Any piece of content like blog, article, page, etc is considered as node. Although, the comments are not stored as nodes but they are always connected to a node.
The template.php file in the theme directory allows you to override a theme function.
Drupal integrates well with external search engines such as Xapian, Apache solr if the built-in search engine does not meet your needs properly.
There are three ways to interact with Drupal search system by implementing :
 
* nodeapi (update index)
* hook_search()
* hook_update_index()
Be default, Drupal doesn't allow the insertion of PHP codes in its pages. To embed PHP codes, you need to activate a Drupal module called PHP filter. By default, this module remains disabled.
  • New Theme Engine : It includes a brand new theming engine called Twig. It is PHP-based, flexible, fast, and secure.
  • Drupal 8 is mobile first now
  • It has extensive multilingual features right out of the box.
  • It has configuration management built into it at the file-system level so that carrying over configuration elements in Drupal 8.
  • Easy Authoring : It bring unprecedented power into the hands of the Content Editor, with WYSIWYG editor CKEditor now bundled with the core.
  • Views Now Part of its Core :
  • Better Support for Accessibility
  • Web Services in-Built in Drupal 8
  • In Drupal 8 it has Guided Tour
  • JavaScript Automated Testing in Drupal 8
  • Loading Speed improvement in Drupal 8.
It is a powerful core module, gives our sites use of the organizational keywords known in another systems as categories or tags, or metadata. Taxonomy allows you to connect, relate and classify your website's content. These terms are gathered within "vocabularies". It is the practice of classifying content.
Here is a code to insert data from the form to the table in a database in Drupal 8 :
public function submitForm(array &$form, FormStateInterface $form_state) {
$field = $form_state->getValues();
$name = $field['name'];
$email = $field['email'];
$field_arr = [
   'name' => $name,
   'email' => $email
];
$query = \Drupal::database();
$query->insert('users')
   ->fields($field_arr)
   ->execute();
drupal_set_message("data successfully saved");
}
It is an acronym for PHP Data Objects. It is a lean, consistent way to access databases. PDO is just like a data access layer which uses a unified API.

To enable PDO, configure --enable-pdo and --with-pdo-sqlite --with-pdo-mysql or whatever database needs supporting by PDO

For windows users : For Apache, you will need to make sure php_pdo.dll and php_pdo_mysql.dll exist in the php/ext directory, un-comment or add the appropriate lines in php.ini, after that you have to restart the web server. In windows it may no longer be required to enable PDO when using newer versions of PHP, PHP version 5.3 and later. It refers to php_pdo.dll. However, you still need to activate php_pdo_mysql.dll for MySQL or for whichever database you are using.
Order history is dependent on the ordered products made by the user through the use of checkout. It includes history of the product which includes order number, user name, order status etc.
On June 3, 2020 Drupal 9 was released, representing an important next step in the evolution of Drupal by building upon what already exists in Drupal 8 and laying the foundation for the future.
 
But as Dries Buytaert, Drupal founder and project lead, says: "The big deal about Drupal 9 is...that it shouldn't be a big deal."
 
Among other enhancements, Drupal 9 provided improvements to the experimental administration theme, Claro, and introduced the experimental front-end theme, Olivero, which focuses on greater accessibility.
This is an important part in the Drupal Back-End. Any changes done in this configuration, will affect the entire website. Here you can do the user account setting, site information setting or any other general site setting.
Taxonomy can be thought of classifying website content which display specific content based on taxonomy terms.
It displays the list of articles or pages which are created. It is a first screen that will get displayed when you log into administration area.
In this menu you can create, manage and find new pages. Here, the table gets displayed with the detail of the article i.e. status, title, updated, author and operation (Edit and delete).
Structure includes the blocks, manage content types, add new menu links to the site and manage administrative tagging of content.
In this menu, the lists of themes are displayed. User can install the theme, update the existing theme or switch the themes.
It allows you to publish your blog content on Front Page or you can stick at top of lists as per the demand.
By clicking on Provide a menu link checkbox it shows all the related details of Menu such as Menu link title, Description, Parent item, andWeight.
User Management manages the information of the user, which allows creating or deleting the user, changing passwords, time and roles.
It allows user to access your website without asking them for the username or password.
It allows only those users to access your website, who are authenticated to use it.
Error Handling is a process of detection and finding the resolutions for the errors, this can be programming application errors or communicable errors.
Pane module is used to translate the custom panel's pane with optional title that will be stored as variables and it can be translate or edit quickly.
Aggregator Module takes the content from other websites but does not generate any feeds. It is also known as a feed reader. It gathers, displays texts and images and other sites and blogs.
CTools or Chaos Tool Suite in Drupal is a project-oriented towards better coding for developers. It is basically a set of tutorial classes that have been simplified to explain certain workflows meanwhile also defining some custom functionalities.