Sign3x is a MODX 3 component that provides storage, management, and signing of PDF documents using a Simple Electronic Signature (SES). Each signature records the signer's full name, job title, exact date/time, and a unique SHA-256 hash key that can be used to verify the document's authenticity.
| Component | Version | Notes |
|---|---|---|
| MODX Revolution | 3.x | Required |
| PHP | 8.1 or higher | Required |
| MySQL / MariaDB | any current | Required |
| pdoTools | any current | Optional — required only for Fenom templates (&fenom=`1`) |
| FPDI + TCPDF | — | Included in the package — required only for the visual PDF stamp feature |
sign3x_documents — documentssign3x_profiles — signer profilesmgr). Signing rights are additionally restricted by user groups via the sign3x_allowed_groups setting.
All settings are located in the sign3x namespace. Navigate to: Administration → System Settings → filter by "sign3x".
| Setting Key | Default | Description |
|---|---|---|
sign3x_allowed_groups |
(empty) | IDs of user groups that have signing rights, comma-separated: 1,5,12. Sudo users (super-administrators) skip the group check — they only need a signer profile. |
sign3x_secret_salt |
(empty) | Secret salt used when generating the SHA-256 hash key. Set any complex string. Never change this after the first document is signed — changing it invalidates all existing hash keys. |
sign3x_upload_dir |
assets/sign3x/uploads/ |
Directory for uploaded PDF files, relative to the site root. The directory must be writable by the web server. |
sign3x_filename_mode |
translit |
File naming strategy on upload: translit — transliterated name, original — original filename, unique — UUID-based unique name. |
sign3x_delete_files |
Yes |
Delete the physical PDF file from disk when a document is deleted from the system. |
sign3x_frontend_css |
assets/components/sign3x/css/frontend.css |
URL of the built-in frontend stylesheet for the Sign3x snippet. If empty, no styles are loaded — useful when you provide your own CSS. Accepts a relative path (from site root) or a full URL. |
| Setting Key | Default | Description |
|---|---|---|
sign3x_pdf_stamp |
No |
Enable the visual stamp in the PDF file upon signing. The FPDI and TCPDF libraries are included in the package. |
sign3x_pdf_stamp_mode |
overlay |
Stamp placement mode: overlay — overlaid on the last page (bottom-right corner), newpage — a separate "Signature Sheet" page appended to the document. |
sign3x_stamp_title |
ELECTRONIC SIGNATURE (SES) | Stamp heading in the PDF (both modes). |
sign3x_stamp_page_title |
SIGNATURE SHEET | Page title for the signature sheet (newpage mode). |
sign3x_stamp_hash_label |
Hash key (SHA-256): | Label above the hash key (newpage mode). |
sign3x_stamp_law_text |
This document has been signed with a Simple Electronic Signature… | Legal compliance text inside the stamp box (newpage mode). |
sign3x_stamp_verify_text |
To verify the signature, compare the hash key with the data in the system. | Verification hint below the stamp box (newpage mode). |
sign3x_stamp_footer_text |
Generated automatically by Sign3x (MODX 3) | Page footer text (newpage mode). |
Open the Sign3x panel via: Extras → Sign3x. The interface has two tabs.
This tab manages signer profiles — records that link a MODX user account to the full name and job title that will appear in the signature.
| Field | Description |
|---|---|
| MODX User | The linked manager account |
| Full Name | Signer's full name (recorded in the signature) |
| Job Title | Signer's position (recorded in the signature) |
sign3x_allowed_groups. If either condition is missing, the Sign button will not appear and any signing attempt will return an error.
Exception: users with the sudo flag (super-administrators) skip the group membership check — a profile alone is sufficient.
A table of all uploaded documents with search, pagination, and colour-coded status.
Search works across: document name, signer's full name, and hash key.
Available actions:
| Button | Description | Condition |
|---|---|---|
| Upload Document | Uploads a PDF and creates a document with Draft status | Always available |
| Sign | Opens the signing confirmation dialog | Drafts only + current user has signing rights |
| Delete | Removes the document from the database (and the file, if the setting is enabled) | Always available; requires confirmation |
The snippet outputs signed documents (status = 1) on the front end with an electronic signature icon and signer information.
| Parameter | Type | Default | Description |
|---|---|---|---|
&id |
int | not set | ID of a specific document. When set, only that document is rendered. |
&limit |
int | 20 |
Maximum number of documents to display. Documents are sorted by signing date, newest first. |
&tpl |
string | sign3x.doc.default |
Template for a single document. Accepted values:
|
&fenom |
0 / 1 | 0 |
Process the template via Fenom (pdoTools). When 1, chunks use {$placeholder} syntax; when 0, standard MODX [[+placeholder]] syntax is used. Requires pdoTools to be installed. |
| Placeholder | Description |
|---|---|
id | Document ID |
name | Document name (HTML-escaped) |
file_url | Full URL to the PDF file |
file_path | File path relative to the site root |
signer_fio | Signer's full name |
signer_position | Signer's job title |
signed_at | Signing date and time (format: dd.mm.yyyy hh:mm:ss) |
hash_key | SHA-256 signature hash key |
aria_label | Full ARIA label for the signature icon (accessibility) |
assets_url | URL of the assets/ directory — for SVG icon references |
<!-- Output the 20 most recent signed documents, default template -->
[[!Sign3x]]
<!-- With a custom limit -->
[[!Sign3x? &limit=`5`]]
<!-- A single specific document -->
[[!Sign3x? &id=`3`]]
<!-- Custom chunk (MODX syntax) -->
[[!Sign3x? &tpl=`sign3x.doc.bs5`]]
<!-- Custom chunk (Fenom syntax, requires pdoTools) -->
[[!Sign3x? &tpl=`sign3x.doc.bs5.fenom` &fenom=`1`]]
<!-- Inline Fenom template -->
[[!Sign3x? &tpl=`@INLINE <a href="{$file_url}">{$name}</a>` &fenom=`1`]]
The component ships with six ready-to-use template chunks:
| Chunk | CSS Framework | Syntax | Notes |
|---|---|---|---|
sign3x.doc.default | Built-in (frontend.css) | MODX [[+]] | Default chunk |
sign3x.doc.default.fenom | Built-in (frontend.css) | Fenom {$} | Requires pdoTools |
sign3x.doc.bs5 | Bootstrap 5 | MODX [[+]] | — |
sign3x.doc.bs5.fenom | Bootstrap 5 | Fenom {$} | Requires pdoTools |
sign3x.doc.uikit3 | UIKit 3 | MODX [[+]] | — |
sign3x.doc.uikit3.fenom | UIKit 3 | Fenom {$} | Requires pdoTools |
All chunks are editable via Elements → Chunks and can be freely copied and customised to match your design.
All chunks include:
Fenom is a template engine with {$var} syntax and conditionals like {if}...{/if}. It is provided by the pdoTools component and does not depend on the MODX "Allow Fenom on pages" setting.
| Task | MODX syntax | Fenom syntax |
|---|---|---|
| Output a variable | [[+name]] | {$name} |
| Conditional block | — | {if $signer_position}...{/if} |
| Escaping | Done in PHP | Done in PHP |
Example Fenom chunk with a conditional:
<div class="sign3x-document">
<span class="sign3x-stamp" aria-label="{$aria_label}">
<img src="{$assets_url}components/sign3x/img/sign3x.svg" width="32" height="32" alt="">
</span>
<a href="{$file_url}">{$name}</a>
{if $signer_position}
<small>{$signer_position}</small>
{/if}
</div>
Snippet call with a Fenom chunk:
[[!Sign3x? &tpl=`sign3x.doc.default.fenom` &fenom=`1`]]
The built-in stylesheet is loaded automatically when the sign3x_frontend_css setting is not empty (default: assets/components/sign3x/css/frontend.css).
To disable the built-in styles and use your own CSS, clear the sign3x_frontend_css setting.
| Class | Description |
|---|---|
.sign3x-list | Wrapper for the default template: vertical flex list with gaps |
.sign3x-document | Single document row: flex container (icon + link) |
.sign3x-stamp | Icon trigger element with the tooltip |
.sign3x-stamp-icon | SVG signature icon |
.sign3x-stamp-tooltip | Tooltip containing full signature details |
.sign3x-stamp-key | Hash key display (monospace font, auto word-wrap) |
.sign3x-doc-link | Link to the PDF document |
When sign3x_pdf_stamp is enabled, a visual stamp is added to the PDF file upon signing. The FPDI and TCPDF libraries are included in the package.
| Mode | Description |
|---|---|
overlay | A blue rectangular stamp overlaid on the last page of the document (bottom-right corner) |
newpage | A separate "Signature Sheet" page appended to the end of the document |
When a stamped file is created successfully, the original file is replaced with the signed version and the path is updated in the database. If an error occurs (e.g. the file is protected or a library fails), the document is saved without the stamp and the error is logged in the MODX error log.
sign3x_stamp_* system settings.
Every signature comes with a unique SHA-256 hash key generated from the following data:
SHA-256(id|name|file_path|fio|position|signed_at|salt)
| Component | Value |
|---|---|
id | Document ID in the database |
name | Document name |
file_path | File path at the time of signing |
fio | Signer's full name from the profile |
position | Signer's job title from the profile |
signed_at | Exact signing date/time (MySQL datetime format) |
salt | Secret salt from the sign3x_secret_salt setting |
The hash key is displayed:
sign3x_secret_salt after the first document has been signed. Changing the salt makes it impossible to reproduce existing hash keys, effectively invalidating the verifiability of all previously signed documents.
Sign3x — a component for MODX 3. This documentation corresponds to the current version of the component.