The Coding phase of Google Summer of Code 2019 commenced in the last week on May 27, which marks the end of the Community bonding period. As stated in my previous post, the community bonding period gives the students an opportunity to build affinity with the community and learn more about the project and the organization.
Currently, I am working on porting Icon API module to Drupal 8, under the guidance of Chiranjeeb Mahanta, which integrates the Icons into the Blocks, Menu Items, Fields and the content using the shortcodes and it makes the website look beautiful by using the right Icon at the right place. For the first phase/month of the coding period I plan to port the following features:
-
Learnt how to implement the Plugin API which will allow the new Icons bundles to be integrated into the main module and the Icon bundles can accessed from any of the sub-modules. To understand the plugin system the article which helped me understand it is "Unraveling the Drupal 8 Plugin System"
-
Learnt the Routing system to create the controller class where the installed and enabled Icon bundles are listed.
-
Implement the Font Awesome bundle using the plugins defined by the main Icon module.
-
Implement the Icon autocomplete controller to allow users to fetch the icon listing based on the input of the user.
-
Implement the Icon data fetcher class which will fetch the icon and provide the Icons which are in accordance with the configuration settings of the specific bundle(in our case it will be from the Font Awesome bundle).
-
Created the .info.yml file to make the module visible and .permissions.yml file to declare permission for the module and the permissions are "administer icons" and "view icons".
-
Created the .routing.yml file to define the path(/admin/config/icons/overview) and controller namespace where the Icon bundle listing is shown.
-
Created the .services.yml file to define the plugin manager class(in our project it is IconBundleManager).
-
Defined the Annotation(for our project it is IconBundle) and the annotation has 4 fields and are id, label, description, and config_route and Controller class(IconBundleController).
-
Defined the Interface and base class called IconBundleBase and IconBundleInterface to specify the basic methods provided by the Icon bundle.
-
Lastly, created the skeleton for the fontawesome_bundle with the Implementation residing in the Plugin/IconBundle directory of the src/ folder of the icon bundle.
The following screenshot shows the output of the controller class accessed from the path /admin/config/icons/overview with no bundles installed/enabled:
The following screenshot shows the output of the controller class accessed from the path /admin/config/icons/overview with no bundles installed/enabled:
The following screenshot shows the output of /admin/config/icons/overview with the fontawesome_bundle enabled:
During this first week of the coding period there were few difficulties that I've faced like I wasn't sure how to Implement the Plugin system in Drupal 8 and how can I make the Icon bundles be listed on the main modules controller page(/admin/config/icons/overview). I've accomplished these difficulties/challenges by going through the Drupal 8 Documentation on Plugin API, reading articles by drupalize.me (this article was very helpful for me) and referring to the notes on api.drupal.org.
Summing up, The above mentioned are the concepts that I learned and implemented during this week and hope to finish the project on time and learn new things along the way.
For the next week, I will be creating the Form page using the Form API for the Font Awesome's Configure Bundle button which is provided in the Icon bundle listing page and define the libraries for the Font Awesome Icon bundle in the libraries.yml file.
Cheers!!
Comments
Post a Comment