---
title: "Drupal 8: Writing your first Drupal 8 custom module -- info file | Drupal Development Agency | Hire Drupal Developers | Web and mobile app Solutions | Joshi Consultancy Services"
description: Drupal 8 has been rewritten from scratch and it heavily uses OOP. And this affects all the way we write code for Drupal 8, be it a custom module for your project or a contributed module that you want to publish on drupal.org
image: https://e.joshics.in/hubfs/Imported_Blog_Media/Drupal-custom-module-info-file.png
---

[Skip to content](https://e.joshics.in/blog/drupal-8-writing-your-first-drupal-8-custom-module-info-file#main-content)

![JOSHI-23052020-Bold-Tag-Full-text-high-res](https://e.joshics.in/hs-fs/hubfs/JOSHI-23052020-Bold-Tag-Full-text-high-res.jpg?width=1432&height=527&name=JOSHI-23052020-Bold-Tag-Full-text-high-res.jpg)

Open main navigation

Close main navigation

- [Contact us](http://jos.cx/contact)

[Contact us](http://jos.cx/contact)

 Sep 16, 2020 5:27:45 PM

# Drupal 8: Writing your first Drupal 8 custom module -- info file

[Bhavin Joshi](https://e.joshics.in/blog/author/bhavin-joshi)

Share: [facebook-f icon](http://www.facebook.com/share.php?u=https://e.joshics.in/blog/drupal-8-writing-your-first-drupal-8-custom-module-info-file) [linkedin-in icon](http://www.linkedin.com/shareArticle?mini=true&url=https://e.joshics.in/blog/drupal-8-writing-your-first-drupal-8-custom-module-info-file) [Twitter icon](https://twitter.com/intent/tweet?url=https://e.joshics.in/blog/drupal-8-writing-your-first-drupal-8-custom-module-info-file) [pinterest-p icon](http://pinterest.com/pin/create/link/?url=https://e.joshics.in/blog/drupal-8-writing-your-first-drupal-8-custom-module-info-file) [envelope icon](mailto:?body=https://e.joshics.in/blog/drupal-8-writing-your-first-drupal-8-custom-module-info-file)

## Drupal 8 custom module structure

Drupal 8 has been rewritten from scratch and it heavily uses OOP. And this affects all the way we write code for Drupal 8, be it a custom module for your project or a contributed module that you want to publish on drupal.org

Let us dive into the details and learn how to write a custom module for Drupal 8!

In this first article of the ‘Drupal 8: Writing your first Drupal 8 custom module’ series, we will explore the details of the info.yml file.

 

## The info file

With slight modifications, the info file is almost identical to previous versions of Drupal. However, in Drupal 8, it is known as *info.yml* and a few extra parameters/instructions/routines for Drupal 8

In Drupal 8, info.yml file takes following details/routines:

type\*: Is this a module or theme or even a distribution/profile? Allowed values: *string module|theme|profile*

name\*: Name of your custom module/theme/distribution/profile Allowed value: *string \[A human readable name which will be displayed on Modules list page\]* GeoBlocker

description\*: some descriptive text about your custom code. Allowed value: *string \[details about what your module offers\]*

core\*: What Drupal core version this custom code targets. Allowed value: *8.x* (Post Drupal core 8.8, this routine is no longer required)

package: In what group you want to put this custom code in. If you do not specify this routine, Drupal puts your custom code under ‘others’ on modules list page. Allowed value: *string* Geo

core\_version\_requirements: Specifically used to denote that your custom code/module is compatible with Drupal 9 and can be used on a Drupal 9 website without modifying code.  
  Allowed value: *^8 || ^9*

configure: If your module offers a configuration page, you need to provide reference to relative path to the configuration page here, as in your routing.yml file.

*\* required routine*

 

Here is an example of actual Drupal 8 / 9 module info.yml file

```

type: module name: GeoBlocker     description: "Restricts or allows access to the website, or to a subset of nodes, in regards of user's country of origin." configure: geoblocker.configuration_form package: Geo core_version_requirement: ^8.8 || ^9
```

![Durpal 8 custom module -- Info file | Joshi Consultancy Services](https://e.joshics.in/hubfs/Imported_Blog_Media/Drupal-custom-module-info-file.png)

[Drupal Planet](https://e.joshics.in/blog/tag/drupal-planet), [Drupal](https://e.joshics.in/blog/tag/drupal), [Drupal 9](https://e.joshics.in/blog/tag/drupal-9), [Drupal 8](https://e.joshics.in/blog/tag/drupal-8)

## Related posts

[![](https://e.joshics.in/hs-fs/hubfs/Imported_Blog_Media/JOSHI-30072020-filled-background-Sep-16-2021-11-58-28-53-AM.png?height=200&name=JOSHI-30072020-filled-background-Sep-16-2021-11-58-28-53-AM.png)](https://e.joshics.in/blog/drupal-8-migration-drush-commands)

[Drupal Planet](https://e.joshics.in/blog/tag/drupal-planet), [Drupal](https://e.joshics.in/blog/tag/drupal), [Drupal 8](https://e.joshics.in/blog/tag/drupal-8)

## [Drupal 8 Migration Drush commands](https://e.joshics.in/blog/drupal-8-migration-drush-commands)

[Bhavin Joshi](https://e.joshics.in/blog/author/bhavin-joshi) 

 Sep 16, 2020 5:27:45 PM

Drupal 8 migration is always painful if not planned well. You run into 'Trial-and-error' and end up...

[Read more](https://e.joshics.in/blog/drupal-8-migration-drush-commands)

[![](https://e.joshics.in/hs-fs/hubfs/Imported_Blog_Media/Drupal-multisite.png?height=200&name=Drupal-multisite.png)](https://e.joshics.in/blog/drupal-8-multi-site-configurations)

[Drupal Planet](https://e.joshics.in/blog/tag/drupal-planet), [Drupal](https://e.joshics.in/blog/tag/drupal), [Drupal 9](https://e.joshics.in/blog/tag/drupal-9), [Drupal 8](https://e.joshics.in/blog/tag/drupal-8)

## [Drupal 8 Multi site configurations](https://e.joshics.in/blog/drupal-8-multi-site-configurations)

[Bhavin Joshi](https://e.joshics.in/blog/author/bhavin-joshi) 

 Sep 16, 2020 5:27:45 PM

To create multiple Drupal 8 sites using a shared Drupal 8 code base, you must complete the...

[Read more](https://e.joshics.in/blog/drupal-8-multi-site-configurations)

[![](https://e.joshics.in/hs-fs/hubfs/Imported_Blog_Media/JOSHI-30072020-filled-background-Sep-16-2021-11-58-28-53-AM.png?height=200&name=JOSHI-30072020-filled-background-Sep-16-2021-11-58-28-53-AM.png)](https://e.joshics.in/blog/drupal-8-update-five-minutes)

[Drupal Planet](https://e.joshics.in/blog/tag/drupal-planet), [Drupal](https://e.joshics.in/blog/tag/drupal), [Drupal 9](https://e.joshics.in/blog/tag/drupal-9), [Drupal 8](https://e.joshics.in/blog/tag/drupal-8)

## [Drupal 8: Update to Drupal 8.8 in five minutes](https://e.joshics.in/blog/drupal-8-update-five-minutes)

[Bhavin Joshi](https://e.joshics.in/blog/author/bhavin-joshi) 

 Sep 16, 2020 5:27:45 PM

Finally, we are one more step closer to Drupal 9. In order to make your Drupal 8 website ready for...

[Read more](https://e.joshics.in/blog/drupal-8-update-five-minutes)

[facebook-f icon](https://www.facebook.com/joshicsin) [Twitter icon](https://twitter.com/joshicsin)

---

[![JOSHI-23052020-Bold-Tag-Full-text-high-res](https://e.joshics.in/hs-fs/hubfs/JOSHI-23052020-Bold-Tag-Full-text-high-res.jpg?width=1432&height=527&name=JOSHI-23052020-Bold-Tag-Full-text-high-res.jpg "JOSHI-23052020-Bold-Tag-Full-text-high-res")](https://e.joshics.in/)

A-919, The One World, Ayodhya Chowk, 150 Feet Ring Road, Rajkot-360006, GJ, India

Copyright © 2026, Joshi Consultancy Services