Travelling Programmer

Lemme learn

Read this first

[Week 13] Final submission

Drupal 8 media solution module - Vijay Nandwani

Link to the entire work done on the module: https://github.com/drupal-media/media/commits/8.x-1.x?author=isthegeek

Link to the module: https://github.com/drupal-media/media/

Link to the blog: https://isthegeek.svbtle.com/

In the summer of 2016, I was chosen under Google Summer of Code to work with Drupal on the media module for Drupal 8. I worked with two awesome mentors Janez Urevc (slashrsm) and Tadej Baša (paranojik) and completed all the features I proposed in my proposal. I would like to thank Drupal’s Google Summer of Code Admins Matthew Lechleider (Slurpee) and Chandan Singh (cs_shadow) for their constant support. Last but not the least, I would also like to thank Google and Drupal for providing this amazing opportunity for students to learn and get involved in Open Source projects. In this report I’ll discuss in detail about the...

Continue reading →


[Week 12] Finishing the crop functionality and improving UI

Hello everyone!

You must have read about the media module on which I was working with Janez Urevc (slashrsm) and Tadej Baša (paranojik) under Google Summer of Code 2016.

According to the timeline, this is the final week of the project and I need to submit the URL to the project this week. The good news is that the module is ready! Yes, you can clone the module from this link right now and start using! All the features which I had proposed in my project statement are done.

This week I finished two important things:

1) Improved the UI and fixed the bugs: There were a number of small bugs in the UI which needed to be fixed. Here is the link to the Pull request which was recently merged to the media module codebase. Earlier the module required masonry and imagesloaded library to provide the grid effect. In the pull request, we removed the dependencies to use pure CSS to provide the grid...

Continue reading →


[Week 11] Finishing Embedding and Fixing UI

Hello All!

I mentioned in my introduction blog post about the media module for Drupal 8 on which I was working on with Janez Urevc (slashrsm) and Tadej Baša (paranojik) under Google Summer Of Code 2016.

This is the last week of GSoC and the submissions start from next week. The journey so far has been amazing and we are almost ready to release the module on Drupal.org official modules repository. The main focus this week was to polish the main features of the module to make the module easier to use. Let me go over the issues we fixed this week:

1) Last week, I wrote about how I modified the hook_install() code to automatically enable the embedding functionality when the media module is installed. It made it simpler for the users to embed content without having to modify the editor settings and filters. But we found that it didn’t work with the Drupal sites which have custom editors...

Continue reading →


[Week 10] Fixing embedding issues and improving UI

Hello everyone!

I have already mentioned in my introduction blog post about the media module for Drupal 8 on which I was working on with Janez Urevc (​slashrsm) and Tadej Baša (​paranojik) under Google Summer Of Code 2016.

This week I worked with my mentors on two issues:

1) Enabling the embedding functionality when the module is installed.

Last week, I created the embed button and entity browser for the media module. The users had to enable the button and filters from settings. To make things easier for users, we wanted to enable the button by default.

The editor module doesn’t provide any hook to add buttons to toolbar. I tried to add the buttons using the hook_editor_js_settings_alter().

/**
 * Implements hook_editor_js_settings_alter().
 */
function media_editor_js_settings_alter(array &$settings) {
...

Continue reading →


[Week 9] Adding the embed functionality in wysiwyg editor

Hello Drupalers!

You must have already read my introduction blog post about the media module for Drupal 8 on which I was working on with Janez Urevc (​slashrsm) and Tadej Baša (​paranojik) under Google Summer Of Code 2016.

Last week I wrote a blog post about the three new media bundles which were added to the media module. Those bundles provided the functionality to add documents, tweets and instagram posts to the Drupal sites.

This is how the media library looked with the new media bundle entities
download.png

This week, I worked on the embed functionality in wysiwyg editor. Let’s get into more details.

Drupal 8 comes with wysiwyg editor called the CKEditor in the core. There are two contributed modules, Embed and Entity Embed, which allow users to create embed buttons for the editor. I created an embed button for embedding different types of media entities in the editor. Here is the pull...

Continue reading →


[Week 8] Adding three new bundles!

Hello everyone!

I have already mentioned in my introduction blog post about the media module for Drupal 8 on which I was working on with Janez Urevc (​slashrsm) and Tadej Baša (​paranojik) under Google Summer Of Code 2016.

In week 8, I finished working on three new bundles: Document, Twitter and Instagram. Yes that’s right, you can now easily embed twitter tweets and instagram posts in your Drupal site! Let’s get into more details!

1) Document Bundle: The document bundle will allow users to upload documents of various types such as PDF, PPTX, DOCX, XLSX etc on Drupal websites. The bundle also ships with 12 file icon types for most used document types. And moreover, its easy as ABC to add new icons in the bundle. All you need to do is rename your icon file with its mimetype and then copy to the right directory.

For example: A new icon for text file should be named text-plain.png...

Continue reading →


[Week 7] Adding more functionality to media views and EB

Hello Drupalers!

You must have already read my introduction blog post about the media module for Drupal 8 on which I was working on with Janez Urevc (​slashrsm) and Tadej Baša (​paranojik) under Google Summer Of Code 2016.

Last week I wrote a blog post about the changes I made to the Media library views and entity browser.

Let me give you a brief introduction about what are entity browsers. Entity browser is a drupal module which provides a generic entity browser/picker/selector. One can easily add widgets such as views, entity forms or DropzoneJS file upload forms to an entity browser. You can see the demo of a entity browser in my GSoC mid term post.

The media module currently has two Entity browsers. One is for selecting and attaching media to various content types and the other one is for creating gallery. Entity browser for gallery is a super simple way to create gallery by...

Continue reading →


[Week 6] Fixing media library Entity Browser

Hello Drupalers!

You must have already read my introduction blog post about the media module for Drupal 8 on which I was working on with Janez Urevc (​slashrsm) and Tadej Baša (​paranojik) under Google Summer Of Code 2016.

Last week I wrote a blog post about the media library which we had finished. I also posted a video showing a demo of the module.

This week I fixed a couple of issues we found in our Entity Browser and Library Views. You can see this week’s pull request here. I’ll briefly discuss the issues which I fixed:

1) Fixing permissions: There were few problems with the permissions required to access the view. This is now fixed.
2) Adding widgets to EB: Earlier the entity browser only had two widgets. I added two more widgets for “My Media” and “Add Video” this week.
3) Gallery uses EB: To create slideshows, one can just select media from the Entity browser widgets. It is...

Continue reading →


[Week 5] Media library and midterm results

Hello everyone!

I had previously written a blog post about the media module for Drupal 8 on which I was working on with Janez Urevc (​slashrsm) and Tadej Baša (​paranojik) under Google Summer Of Code 2016.

This week we finished the media library for the module and pushed it to the main repository. I had given a brief introduction about media library in my last week’s post. As promised, here is a demo video of the media module:

So the media library currently uses masonry for displaying the media items. There are few things which we still have to fix, but a basic module is ready to be used. You can find the stable code for the module here.

This week was the midterm review week and everyone is done with at least half of their project. Here is an overall analysis for media module.

Done:

1) Investigating Lightening distribution and understanding they way they solve the problem.
2)...

Continue reading →


[Week 4] Media library and fixing slideshow

Hello fellow Drupalers!

Four weeks ago I had written a blog post about the media module for Drupal 8 on which I was working on with Janez Urevc (​slashrsm) and Tadej Baša (​paranojik) under Google Summer Of Code 2016.

I am really excited to inform you all that we merged the gallery bundle today with the main repository. It uses the Slick media module which provides integration between the Slick Carousel and the media entity modules. Now using the media module everyone can easily publish media content of slideshow type consisting of images and/or videos as slides. The media module comes with its own image styles and view modes for the gallery items.

Before moving on to an even more exciting part, the media library, let me discuss the issues we faced with the gallery bundle. When I first opened the pull request, Travis CI tests failed with some schema errors. The error said

The test...

Continue reading →