Welcome to the Monkii Code Test.
If you're reading this message, you have probably been in touch with Monkii about a role as a Drupal Developer.
This repo contains a set of exercises for Drupal developers which will give you an opportunity to demonstrate your level of skill and problem solving capabilities.
You should plan to spend 3 - 4 hours completing the exercises in this test. You may not finish everything, so prioritise the tasks which you feel most comfortable completing.
This repo contains a pre-configured vm and a bare Drupal 8 installation. To complete the test, you should:
- clone the repo
- install the pre-requisites (VirtualBox and Vagrant)
- initialise the vm (this takes a while!)
- complete the exercises in this README
- zip up the entire
code-test-drupal
folder and email it to [email protected]
Important: please do not fork the repo or push your completed test to a public repo.
Install the latest versions of the pre-requisites:
Navigate to the repo in a terminal and start the vm:
vagrant up
Vagrant will ask you to enter your password at some points in order to create NFS shares. Once you've reached this point, go make a coffee/tea as it may take 10-20 minutes to complete.
When the vm is ready, you should be able to navigate to your new Drupal site at http://monkiicode.test.
You can log in as:
- Username:
admin
- Password:
admin
Each exercise is worded as a feature request, so pretend we are an important client who you want to keep very happy.
Tasks should be completed using a combination of the techniques at your disposal as a seasoned Drupal developer, such as:
- contributed modules and base themes
- custom module(s)
- custom theme
- Drupal config
- other libraries
When deciding how to complete each exercise, here are a few things to keep in mind:
- the feature should be easy to use for "the client"
- code should be easy to understand and maintainable
- git commits should be organised with good commit messages (yes we will be checking!)
- there should be no manual steps to "deploy" your feature. For example, if a taxonomy needs to be created, it should be done with code or config that's committed to the repo.
Don't be too concerned with styling / presentation, as we are not including designs with these exercises. It's ok if pages look quite basic, but use your judgement.
When you're all finished with the test, make sure you've
committed your features to your local repo and then zip up
or archive the entire code-test-drupal
folder. This should
be sent in an email to [email protected]
with any notes you'd like to include about your submission.
You might also want to clean up your vm by navigating to the project folder in a terminal and typing:
vagrant destroy
The Ubuntu-based vm in this project is based on the excellent DrupalVM project by geerlingguy: https://github.com/geerlingguy/drupal-vm
Once provisioned, you can access the vm via the command:
vagrant ssh
Inside the VM, this project folder will be mounted at:
/var/www/drupalvm
The Drupal install will be in:
/var/www/drupalvm/drupal
The Drupal installation has been created using composer. Normally this would mean that Drupal core and contributed modules would not be committed to the repo, but in this case having all the code in the repo makes things a bit easier.
If you want to use a contributed module from drupal.org, you should still use composer to add it to the repo, ie:
composer require drupal/MODULE_NAME
Composer can also be used to add non-Drupal libraries to
the project. All dependencies added this way will end up in
composer.json
and composer.lock
, which should be
committed to the repo.
If you're familiar with drush, you can use it to speed up
a lot of your tasks. Here are a few useful commands, but
there are many more that can be discovered just by running
drush
in the Drupal folder inside the vm.
drush pm:enable MODULE_NAME
Note: contributed modules should be downloaded first via composer.
drush cache:rebuild
drush config:export
Note: this is a great way to build things like content types and taxonomies, and configure modules. Running this command will write your Drupal config to yaml files in the folder:
drupal/config/sync
Files in this folder should be committed to the repo so that everything needed for your feature can be deployed.
The first task is to create a content type for News Articles. Each News Article should include:
- Title
- Publication date
- Author name
- Body
News Articles should auto-generate a URL like:
/news/DATE/ARTICLE_TITLE
Create a listing of News Articles visible on the home page.
- List Articles from newest to oldest based on Publication date
- Add pagination if there are more than 4 News Articles
Each News Article in the listing should include:
- Title
- Publication date
- Author name
- Text snippet no greater than 60 characters
- Link to the full article
Create a user role for Authors.
Authors should be able to:
- log in to the backend
- create a new News Article
- edit an existing News Article
- publish/unpublish a News Article
Add a required Category field to News Articles, with the options:
- Announcements
- Press releases
- Events
Authors should be able to add a new category.
Authors should be able to select a colour for each category.
When an article is displayed, the category colour should be used as the background colour behind the article Title.
When an article is shared to social media, it should have information such as title, author and description automatically populated from the Title, Author and Body of the News Article.
Add the ability for users to set their first name and last name.
Remove the "Author name" field from News Articles.
When displaying a News Article, display the first name and last name of the user in place of the Author name field.
We're so excited to see how you solve these problems, and look forward to working with you in the near future. :)