This video shows how Simplytest.me can automatically download third-party libraries using a .make file. You'll even see how easy a .make file is to create, in case the module you want to use doesn't come with one already.
Some modules require a third-party library. FullCalendar is one of those modules (it also happens to be my favorite calendar module). On the Installation instructions page it says that you need to install the FullCalendar jQuery plugin to the “sites/all/libraries” folder. Well, due to security reasons, we don’t have FTP access to sites on Simplytest.me. Luckily, because it’s using Drush on the backend, as long as a module has a .make file with instructions to download the library, it’ll be done on Simplytest.me as well!
Currently, FullCalendar doesn’t come with a .make file, so it won’t work on Simplytest.me. But, as it turns out, the process to create one is actually very easy. I didn’t know what I was doing at first, but Patrickd was awesome, and put together a .make file for the FullCalendar library, so let’s take a look at how it works.
Inside the fullcalendar.make file, you’ll see that all it does is specify that we need to get (or download) a library, where to get the library from, and it needs to be extracted to the directory “fullcalendar” inside the “libraries” directory. The last line specifies the files within the extracted directory that should be copied. If we take a look at what we get when we extract the archive, you’ll see there’s a demo folder, and other files that we don’t want. This just copies the files we need.
Not only do those five lines of code mean that the library will be automatically installed when you use Drush, it also means that we can test out the FullCalendar module on Simplytest.me. Let’s try it out! Since this patch hasn’t been committed yet, I’m going to go ahead and apply through the Simplytest.me interface.
- Go to http://simplytest.me/project/fullcalendar/7.x-2.x?patch[]=http://drupal.org/files/fullcalendar-addsimplytestmake-1_0.patch&add[]=devel (I’m also installing devel to quickly create content. Also, once this patch is applied to the project, anyone will be able to try it just by typing “FullCalendar” into the project field.)
- Click “Launch sandbox”
- Login and go to the modules page
- Add a date field to the article content type
- Use Devel generate to create some articles
- Go to “Structure => Views => Add new view”
- View name: Calendar
- Display format: FullCalendar
- (Continue and Edit)
- Add the (date) field
- Save the view
Now we can take a look at the view, and play with the events, view the calendar by week or day, move the events to different days and times etc.
So that’s how Simplytest.me can automatically download third-party libraries that are required by modules!