Code Snippets

How to Debug Drupal?

If you got a generic error in Drupal and are not sure why then it's time to enable Drupal Debugging options and error reporting to better understand the error.

Translating views strings programmatically in Drupal 8

In Drupal 8 views strings like sort options, header, footer or any other string can only be translated through configuration translation but here is a code snippet to add translations for a view programmatically with config override.

Get user current language in Drupal 8

Here is the quick code snippet of how we can get the current language code, current language name and all enabled languages in Drupal 8 for multilingual sites.
Subscribe to Code Snippets