June 05, 2024
Drupal Modules: Computed Fields, Fast Permission
Today we present a couple of Drupal modules that allow us to create and manage calculated fields for our content type.
Drupal Modules for Content Management.
Computed fields: Given a content type, it allows creating computed fields based on the value of other fields within the same content. For example, if we have a content type 'car' with the fields 'model', 'engine', and 'province', we could create a 'subtitle' field that automatically takes the value "[model] [engine] in [province]". However, this module would also be very useful if we had an Entity Reference field with multiple possible values. It is worth noting that the module allows us to choose whether we want to save the field in the database or not. If we do not save it in the database, each time the node is viewed, the field will have to be recalculated, which will not result in a significant performance penalty. Therefore, it is recommended to always save the field in the database. However, it is better not to do so until we have finished debugging the PHP code that calculates its value. On the other hand, one of the virtues of this module is that it works well with the Views and Search API modules (we can index computed fields).
Computed Field Tools: Installing this module is essential if we have computed fields in our content types. Indeed, computed fields saved in the database are only calculated when a node is saved. Therefore, if we create one of these fields when we already have many nodes, we can use this module to automatically recalculate the fields for all existing nodes.
Fast Permission Administration: This module modifies the permission administration screen to make it much more user-friendly: it groups permissions by modules, incorporates an advanced permission search that filters the displayed rows, and keeps the table header visible even when you are at the bottom. With this module, we can forget about endless scrolling to find permissions, searching for the save button, and remembering which role each checkbox column belongs to before scrolling.
Shiny: It is our preferred administrative theme after the Adminimal theme. It is very pleasing to the eye and facilitates user interaction thanks to its color scheme. The only drawback compared to Adminimal is that it is not responsive. It is the default theme in the Drupal distribution Commerce Kickstart.
Share