Your company has a complex website to create. Drupal was chosen as the main technology. None of the PHP developers have done anything in Drupal before or they have little experience. If this is your case, read this text before starting the development of your project. You will learn the risks and you will be better prepared to start the works.
Below you will find 9 important things to take a look at before launching the programming works. If you will take proper care of each of these areas, you will be able to implement the project efficiently.
1. Ensure the right workflow in the team
Creating Drupal-based websites by one person is a completely different kettle of fish in comparison to working as part of a team. If you build a team of freelancers who have previously worked alone with Drupal, you should expect problems. If this is a team that knows PHP but has no experience with Drupal, you should expect even bigger problems.
Before starting, you must establish common principles, a common way of working. You should establish the following:
- Working rules in the code repository (Git or others)
- Coding standards
- Code flow
- Database and files flow
- Distribution of tasks in such a way that they do not interfere with each other and that no works are being performed on the same pieces of code. If it is not possible, communicate often so as not to duplicate the works being performed.
Thanks to these establishments, the team will know how to work together and focus on implementing the programming tasks.
2. Implement the tasks in the same standard
It often happens with Drupal that every programming task can be done in many ways. It is important to establish common rules.
One example is the way of creating the contents. It is worth to determine if the contents will be created using the Layout Builder, Paragraphs, Gutenberg module, or another similar solution. Using several modules at the same time may result in problems.
There are many more such decisions to be made when using Drupal. It is good to establish common standards.
A system of supervising the application of these rules is also necessary, e.g. if the deadline of a sprint or stage is drawing near, then you should not take any shortcuts but rather stick to the standards.
3. Get to know the configuration options in Drupal well
It is a common problem if you employ PHP developers for Drupal works. They start to solve a lot of tasks by creating code. Sometimes they spend dozens of hours creating functionality that is already provided in Drupal.
In many cases, you just have to go to the right place in the administration panel, click around a few times, and that is it.
It is the extensive configuration options of the Drupal's core and its modules that constitute the strength of Drupal. They allow you to save hundreds or even thousands of man-hours spent on programming works.
Use the ready-made Drupal options in your project and save the client's money.
4. Get to know the Drupal's API well
Getting to know the Drupal's API helps you accomplish many tasks faster than using only PHP.
If someone is not familiar with the Drupal's API, they sometimes create functions or classes that are already in the Drupal's core. This can turn out to be a waste of time.
The lack of knowledge concerning the API sometimes may also cause errors that are difficult to detect. An example would be adding the common PHP redirection header ('Location: '.$newURL); in hook_entity_insert. If there are many modules in the system using this hook, it is possible that not all will be executed after adding such a redirection.
You can find more examples like this. Before starting the works, it is good to familiarise yourself with the Drupal's operation. The very minimum would be to read one of the books describing the creation of modules for Drupal.
The Examples module is another important source of knowledge. Here you will find a huge number of examples. It is good to look through the codes of this module.
5. Use the View-mode
Entity view modes are a very useful functionality of the system. They allow you to customise the view of the content depending on where you want to display it. You can define any modes and use them many times.
Beginner developers often create code for every view mode instead of selecting several different modes and configuring them. It is not worth it. It is better to use a ready-made mechanism in Drupal and complete the tasks faster.
6. Create entities if you plan to create your own tables in the database
Some business requirements force you to create your own tables in the database. When working with Drupal, it is good to add such tables to the database while at the same time creating Entities.
As a result, you get a table that is operated via Entity classes and you can easily integrate the data from such a table with the whole Drupal, e.g. with the Views module.
If you will not use Entities, you will have to program everything concerning this table, e.g. the forms or the data-displaying pages.
7. Write automated tests
Drupal is usually used to create medium- and large-sized websites that are developed over many months or years. When extending the functionality, it may happen that you will break something that was already working correctly.
If you do not want to perform regular manual checks in order to ensure that everything works correctly, you need to have automatic tests written.
Drupal has a PHPUnit framework for automated testing. You can also use other frameworks, e.g. Codeception and the Visualception extension.
8. Automate the application creation and the deployment to the production server
The process of implementing new changes to the production server and the process of creating a website within the local developer environment should be automated. Everyone on the team should use the same scripts to create the application.
You then eliminate the problems of differences between the environments, e.g. when someone has changed something in the configuration on one version, but not on the other. You do not know then what and how should work properly, misunderstandings arise, you waste the time unnecessarily.
All changes should be introduced via code. The team should use a code repository (e.g. Git). You can be sure then that you have the same configuration on every instance of the application.
9. Advise the client if you can do something a little differently but much faster
Drupal offers a huge number of functionalities and additional modules. With them, you can create really large-sized websites.
Sometimes a ready-made module does not meet the requirements of the specification in 100% but it is enough to have a talk with the client about it, and most often the client will agree to a small change in order to save time.
I listed above the most important things that you should pay attention to when creating your first major website based on Drupal CMS.
The Drupal development services at Droptica knows all about these issues. We save our clients' money and provide a lot of solid code in a short time. We do not have to focus on eliminating problems but only on providing value to the clients.
If you plan to build a Drupal-based website, be sure to analyse the potential problems mentioned above, and you will achieve satisfactory results.