This module adds an auto-incrementing number field that can be attached to specific content types or entities. This allows you to generate unique, sequential identifiers for your content, separate from the system's default node IDs, and use them in URLs or other fields.
This module provides an auto-increment (serial) field.
Unlike Drupal's built-in auto-increment node ID, which is global and shared by nodes belonging to all content types, serial fields are managed per content type (D6) / entity (D7). For example, the serial field of an Invoice instance will generate a unique sequential number (starting at 1, then 2, etc.) exclusively for Invoice instances.
The allocation of serial numbers by this module is atomic. In other words, the serial values are unique even when multiple instances of the same content type / entity are created simultaneously.
Dependencies
- Drupal 6 - the CCK module
- Drupal 7, 8 - the core Field module has to be enabled
Optional modules
- Token (http://drupal.org/project/token) - to access serial values as tokens.
- Token + Path Auto (http://drupal.org/project/pathauto) - to use serial numbers in urls, for example:
http://www.example.com/issue/10 (where 10 is a type scope serial number)
instead of:
http://www.example.com/node/64564 (where 64564 is a node id)
Installation
- Copy the serial module directory to your Drupal sites/all/modules/ directory.
- Enable the module in administer > modules (admin/build/modules).
Usage
You can add a serial field to any type at admin/content/types -> manage fields.
In the New Field form select Serial as the type of data and label and field name as your choice, and Save. No other settings.
Notes:
- Existing nodes will also get serial values when a serial field is added.
- The serial token
[{entity_type}:{field_name}]can be used with Path Auto. All information about available tokens can be found atadmin/config/search/path/patternspage in Replacements patterns section. - If you're upgrading from Drupal 6, make sure that this module is enabled before the CCK to fields migration. You'll get one or more errors about trying to create tables that already exist, but you can safely ignore these. Feel free to create an issue & patch to fix that.
Similar Modules
Serial numbers can be generated also by the Type-local nids module. The main differences between the two modules are:
- The Serial Field module provides a CCK field.
- ID allocation by Serial Field is atomic (i.e. the same ID cannot be issued to more than one node).
Ask your assistant about Serial Field
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
- field Drupal core
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Release Timeline
Releases
| Version | Type | Core | PHP | Release date | |
|---|---|---|---|---|---|
| 2.1.0 | Stable | 10–11 | Dec 13, 2024 | ||
| 2.0.0-beta3 | Pre-release | 9–10 | Mar 1, 2024 | ||
| 2.0.0-beta2 | Pre-release | 9–10 | Aug 4, 2023 | ||
| 2.0.0-beta1 | Pre-release | 8–10 | May 9, 2023 | ||
| 2.0.x-dev | Dev | 10–11 | May 9, 2023 |