drupalcogs

Drupal errors that can be avoided using good practices

One of the most powerful CMS platforms on the market is Drupal but you have to know the most common mistakes that a developer can make in this CMS.

Create too many content types

One of the most common mistakes is to use very similar content types to show the same type of information. It is necessary to identify the fields that may be common before creating the content. This could confuse the person in charge of creating the content on the website.

An example can be when the user creates a content type that says about us, that is a bad practice since the basic page content type can be reused.

Don’t name fields specifically to a content type

You should not create many names that are associated in excess to the content type, it is preferable to create generic names that denote exactly the purpose of that field. For example, Drupal brings by default a single created field, the body, which can be used for any type of content is created in the future and stores generic information. If we had created a field  type "news description", where an internal identifier for that field of "field_news_description" , it would probably not occur to us to use it for another type of content (for example for Descriptions), when the The type of information that you are going to store is practically the same.

Unused content types

The websites they build are not static but adapt to the needs of a client. In general, simplifying to allow a more efficient day to day. Therefore, it is important that we make a periodic analysis of our websites and see if the content types we have created are being used.

Don’t reinvent the wheel

Drupal has thousands of contributed modules. Don’t program a new module unless you have previously searched for others and none is adapted to your needs, perhaps there is another that is partially adapted and can serve the client.
If I need to implement a gallery, Drupal provides many modules of the community that can be used.

Change core and contributed modules

Never edit the core or modify the content of a contributed module. It is very common for the contributed modules or the core to be updated, so an update will make you lose the changes, it will make the task of updating very heavy and expensive.
If you find security errors don’t fix only in your project, that will make in addition to the above problems, other developers have the same problem, contribute, make a patch. In the same way, if you think that a module can implement a new functionality, you can contact your "maintainer" and enter the Drupal community.