Dec. 22, 2023, 8:57 a.m. | Julia Lange

DEV Community dev.to

Sometimes, when writing a custom validation rule for a Statamic project, I find myself in a position where I need information about the current entry I am editing.


But because validation rules don’t provide this kind of information I tried some hacky stuff like reading the current entry id from the request URL. But that doesn't work if you have more than two stacks open at once.


Luckily I discovered that Statamic did a nifty thing with their own validation …

access current don editing entry find information kind project request rules url validation writing

Information Security Engineers

@ D. E. Shaw Research | New York City

Technology Security Analyst

@ Halton Region | Oakville, Ontario, Canada

Senior Cyber Security Analyst

@ Valley Water | San Jose, CA

Senior Director, Risk Compliance & Trust (GRC)

@ Snyk | Boston, London

Working Student (f/m/d) - Security Architecture Project Management & Communications

@ SAP | Walldorf, DE, 69190

Werkstudent Cyber Security (w/m/x)

@ BMW Group | München, DE