processwire-hooks

Document ProcessWire CMS hook types, syntax, and event objects.

1|Updated Jan 15, 2026
One-click install
npx skills add https://github.com/webmanufaktur/pwaiworkflow --skill processwire-hooks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: processwire-hooks
Source: https://github.com/webmanufaktur/pwaiworkflow/tree/main/.agents/skills/processwire/hooks
Command: npx skills add https://github.com/webmanufaktur/pwaiworkflow --skill processwire-hooks

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to ProcessWire's hook system, enabling developers to modify and extend core functionality without altering the core files, leading to more maintainable and flexible websites.

Core Features & Use Cases

  • Understanding Hook Types: Learn about before, after, replace, method, and property hooks.
  • Implementing Hooks: See examples for modules, template files, and global scope.
  • Advanced Techniques: Explore URL/path hooks, conditional hooks, hook priority, and creating hookable methods.
  • Use Case: You need to automatically add a custom watermark to every image uploaded through the ProcessWire admin. This skill shows you how to hook into the File::save event to achieve this.

Quick Start

Use the processwire-hooks skill to learn how to add an 'after' hook to the 'Page::render' method.

Frequently Asked Questions about processwire-hooks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use ProcessWire hooks to modify page rendering without changing core files?

ProcessWire hooks allow you to modify page rendering by attaching an 'after' hook to the 'Page::render' method. This intercepts the event object to alter output, extending core functionality while maintaining system flexibility.

What are the different types of hooks available in the ProcessWire CMS?

ProcessWire hook types include 'before', 'after', 'replace', 'method', and 'property' hooks. Each type intercepts specific execution stages to modify or extend core functionalities like data validation and URL handling.

Can I automatically add a watermark to images uploaded through the ProcessWire admin?

Yes, you can automatically add watermarks by hooking into the 'File::save' event. By implementing an 'after' hook, you intercept the uploaded file data and apply your custom watermark logic before final storage.

How do I validate data before saving a page in ProcessWire?

To validate data before saving in ProcessWire, use a 'before' hook on the page save method. This allows you to inspect the event object, apply conditional logic, and halt the process if validation fails.

How do I manage hook priority when multiple hooks target the same ProcessWire method?

ProcessWire allows hook priority management to control execution order when multiple hooks attach to the same method. You configure priority settings to ensure your custom hooks execute in the correct sequence.

Can I create custom URL handlers using hooks in ProcessWire?

Yes, ProcessWire supports custom URL handlers through URL and path hooks. This advanced technique intercepts routing to map custom URLs to your specific logic, bypassing default template rendering.