Field collection can be used in case a field has sub-fields. For e.g Name can have sub-fields such as First Name, Middle Name, and ...
In custom module, Node can be loaded in the following way : use \Drupal\node\Entity\Node; //Don't forget to add a use statement i...
JS library to a view can be attached using hook_views_pre_render(). Use the following code to achieve it: /** * Implements hook_v...
Form cache in Drupal 8 can be disabled in following ways. $form_state->setCached(FALSE); And $form['#cache'] = [&...
Enable the contributor block on drupal.org. This will give you access to all kinds of useful links, as well as tell you how close we a...
$user_id= \Drupal::currentUser()->id(); Using you can get login user ID $user_roles = \Drupal::cur...
# Using Views with a third-party data store Your Drupal website’s “classic” SQL database is far from being the only possible data store...