Another way to add the serial number to the nodes in Drupal 8/9

Another easy way to add a serial number field for a node, based on the ID content.

Add a field of the "Expression" type, where we add the following value to the expression field

[node:nid]+10000

Thus, our field value will consist of the sum of the ID + 10000 value. For example, the ID of the material is 2897, then the serial number will be 12897.

For new materials, the value will be created automatically, but in already existing nodes the value will be added only if you open the node for editing and save, i.e. content update. For a bulk update, you can create a view with bulk editing of fields and mark the checkbox next to our field. The content will update automatically.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
The comment language code.