Sign3x — Simple Electronic Signature for MODX 3

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.

1. Requirements

ComponentVersionNotes
MODX Revolution3.xRequired
PHP8.1 or higherRequired
MySQL / MariaDBany currentRequired
pdoToolsany currentOptional — required only for Fenom templates (&fenom=`1`)
FPDI + TCPDFIncluded in the package — required only for the visual PDF stamp feature

2. Installation

  1. Install the package via the MODX Package Manager (or copy files manually).
  2. After installation, two database tables are created automatically:
  3. Go to System Settings → Namespace: sign3x and configure the options (see System Settings).
  4. Required: create signer profiles in the Employees tab for all users who need signing rights.
Access control. The Sign3x management panel is available only to users authenticated in the MODX manager context (mgr). Signing rights are additionally restricted by user groups via the sign3x_allowed_groups setting.

3. System Settings

All settings are located in the sign3x namespace. Navigate to: Administration → System Settings → filter by "sign3x".

General

Setting KeyDefaultDescription
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.

Visual PDF Stamp

Setting KeyDefaultDescription
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).

4. Administration

Open the Sign3x panel via: Extras → Sign3x. The interface has two tabs.

4.1. Employees Tab

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.

FieldDescription
MODX UserThe linked manager account
Full NameSigner's full name (recorded in the signature)
Job TitleSigner's position (recorded in the signature)
Important: A user must both have a signer profile in this tab and belong to one of the groups listed in 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.

4.2. Documents Tab

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:

ButtonDescriptionCondition
Upload DocumentUploads a PDF and creates a document with Draft statusAlways available
SignOpens the signing confirmation dialogDrafts only + current user has signing rights
DeleteRemoves the document from the database (and the file, if the setting is enabled)Always available; requires confirmation

4.3. Signing Workflow

  1. Click the Sign button next to the desired document.
  2. A modal dialog opens showing:
  3. Click Confirm. The system will:
Signing is irreversible. A signed document cannot be reverted to Draft status through the interface.

5. Sign3x Snippet

The snippet outputs signed documents (status = 1) on the front end with an electronic signature icon and signer information.

5.1. Snippet Parameters

ParameterTypeDefaultDescription
&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:
  • Chunk name: sign3x.doc.bs5
  • Inline Fenom template: @INLINE {$name} (requires &fenom=`1`)
&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.

Placeholders Available in Templates

PlaceholderDescription
idDocument ID
nameDocument name (HTML-escaped)
file_urlFull URL to the PDF file
file_pathFile path relative to the site root
signer_fioSigner's full name
signer_positionSigner's job title
signed_atSigning date and time (format: dd.mm.yyyy hh:mm:ss)
hash_keySHA-256 signature hash key
aria_labelFull ARIA label for the signature icon (accessibility)
assets_urlURL of the assets/ directory — for SVG icon references

5.2. Usage Examples

<!-- 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`]]

6. Built-in Chunks

The component ships with six ready-to-use template chunks:

ChunkCSS FrameworkSyntaxNotes
sign3x.doc.defaultBuilt-in (frontend.css)MODX [[+]]Default chunk
sign3x.doc.default.fenomBuilt-in (frontend.css)Fenom {$}Requires pdoTools
sign3x.doc.bs5Bootstrap 5MODX [[+]]
sign3x.doc.bs5.fenomBootstrap 5Fenom {$}Requires pdoTools
sign3x.doc.uikit3UIKit 3MODX [[+]]
sign3x.doc.uikit3.fenomUIKit 3Fenom {$}Requires pdoTools

All chunks are editable via Elements → Chunks and can be freely copied and customised to match your design.

All chunks include:

7. Fenom Templates

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.

When to use Fenom chunks: whenever you need logic inside the template — conditional output, loops. For example, showing the job title only if it is set.

Syntax Comparison

TaskMODX syntaxFenom syntax
Output a variable[[+name]]{$name}
Conditional block{if $signer_position}...{/if}
EscapingDone in PHPDone 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`]]

8. CSS and Styling

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.

Key CSS Classes

ClassDescription
.sign3x-listWrapper for the default template: vertical flex list with gaps
.sign3x-documentSingle document row: flex container (icon + link)
.sign3x-stampIcon trigger element with the tooltip
.sign3x-stamp-iconSVG signature icon
.sign3x-stamp-tooltipTooltip containing full signature details
.sign3x-stamp-keyHash key display (monospace font, auto word-wrap)
.sign3x-doc-linkLink to the PDF document

9. Visual PDF Stamp

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.

Stamp Modes

ModeDescription
overlayA blue rectangular stamp overlaid on the last page of the document (bottom-right corner)
newpageA 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.

All text in the stamp (heading, legal wording, footer) is configurable via the sign3x_stamp_* system settings.

10. Signature Verification

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)
ComponentValue
idDocument ID in the database
nameDocument name
file_pathFile path at the time of signing
fioSigner's full name from the profile
positionSigner's job title from the profile
signed_atExact signing date/time (MySQL datetime format)
saltSecret salt from the sign3x_secret_salt setting

The hash key is displayed:

Do not change 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.