Drupal 8: Optional dependency injection in Plugin

04 November 2018 — Written by Mitesh Patel
#Drupal 8#Drupal#Dependency injection#Drupal plugin#Drupal services

With Drupal 8 adoption to symfony services, we have benefited with dependency injection, initiating required objects of injected services. In Drupal 8, We also have other areas like plugins, controllers where we extensively use dependency injection with the help of container.

Read more →

Drupal: Trigger ajax request in js manually

03 October 2018 — Written by Mitesh Patel
#Drupal 8#Drupal#ajax

In Drupal, You can trigger ajax call for any html element and anchor links with a specific implementation explained...

Read more →

Django: class based views

27 July 2018 — Written by Mitesh Patel
#python#django

In Django views used to be defined as function, which accepts the request argument and return HttpResponse. Well that is a very easy approach to implement a view for any given path. while there are other drawbacks of using this approach, like:

Read more →

Django: Set path for global static files

25 July 2018 — Written by Mitesh Patel
#python#django

In Django all your custom js/css/images are placed in /static/ directory of your module, But global file should be placed in your application, Django is not supplied with already created / configured global static path. you have to configure it manually.

Read more →

YAML: Share values using alias.

23 July 2018 — Written by Mitesh Patel
#Drupal 8#Drupal#yaml

In YML often we use common values again and again for different purpose. For example, imagine the variation for image_styles for an e-commerce site and most places we use the same style for instance. There's a way to avoid duplication in yml.

Read more →
Copyright © 2021 Mitesh Patel. Built with Gatsby