MonsterSearch - Smarter Manager Search for MODX
MonsterSearch is a compact MODX Manager plugin that improves the built-in quick search: search operators, exact-name queries with quotes and direct ID filtering.
What is MonsterSearch?
MonsterSearch is the lightweight MODX Manager plugin I built to supercharge the built-in quick search. It interprets short search operators (prefixes and symbols), handles exact-name queries using quotes, and allows for direct ID filtering.
The idea sparked from a daily frustration: whenever I double-clicked a Chunk or snippet tag like [[$head]], MODX copied the $ symbol too. Pasting $head into the Manager search returned nothing, because the native search couldn't handle the symbol.
MonsterSearch fixes that. Now, you can copy and paste element tags exactly as they appear, and the search instantly finds the right item.
As projects grow and gather hundreds of Chunks, Snippets, Templates, and Resources, finding things becomes a headache. MonsterSearch solves this by delivering precise, flexible, and lightning-fast results directly inside the Manager interface.
Key Features
- Wildcard prefixes — scope your search results to display exactly what you need.
$= Chunks (e.g.,$headdisplays all Chunks withheadin their name)
!= Snippets (e.g.,!pdoCalldisplays all Snippets withpdoCallin their name)
*= TVs (e.g.,*mainImagedisplays all TVs withmainImagein their name)
+= Templates (e.g.,+mainTemplatedisplays all Templates withmainTemplatein their name)
@= Plugins (e.g.,@migxdisplays all Plugins withmigxin their name)
#= Resources (e.g.,#indexdisplays all Resources withindexin their alias or title)
^= Users (e.g.,^admindisplays all Users withadminin their username)
~= ID (e.g.,~11displays only the item with ID11)
"Footer Snippet"→ Displays the exact element with that name, bypassing fuzzy logic (quoted exact-match search)
Combined Examples — string operators together for ultimate precision.
!~21→ Displays only the Snippet with ID 21 (combines!for Snippets and~for exact ID)
$@ header→ Displays Chunks and Plugins containingheaderin their name (multiple include prefixes)
+"main layout"→ Displays Templates named exactlymain layout(Template prefix + quoted exact search)
- Include & Exclude — mix multiple prefixes or exclude types entirely using a minus sign (e.g.,
footer -* -@). - Fuzzy Search — utilizes the Levenshtein distance algorithm to handle typos gracefully. (Configurable via System Settings).
- MODX 2.x & 3.x — fully compatible with both Manager architectures.
Installation (quick)
- Install the transport package via Package Manager.
- Go to System Settings → choose the
monstersearchnamespace. - Tweak the defaults:
monstersearch.wildcards,monstersearch.fuzzy_threshold. - Clear the site cache and reload the Manager.
Default System Settings
$==chunks||!==snippets||*==tvs||+==templates||@==plugins||#==resources||^==users
MonsterSearch 1.0 Architectural Summary
-
1. Initialization & Context Check
Verifies the existence of MODX and strictly ensures execution only within the
mgr(Manager) context to prevent frontend interference. -
2.
OnHandleRequestEvent (PHP Absolute Interceptor)- ID Search Override: Looks for the
monster_idGET parameter. If present, it completely bypasses native MODX search. - Direct Database Querying: Uses
xPDO/newQueryto search precisely by ID (exact or partial) across multiple tables (Resources, Chunks, Snippets, TVs, Templates, Plugins, Users). - Field Mapping: Ensures correct data extraction (e.g., handles the fact that Resources use
pagetitlewhile Chunks usename). - JSON Payload: Bypasses standard MODX rendering, outputs the exact JSON structure expected by ExtJS, and halts execution (
exit;). - Standard Search Limit Hack: If it's a regular text search, it intercepts the request and forces
top_search_results_limitto 10000 to prevent MODX from truncating results before JS processing.
- ID Search Override: Looks for the
-
3. JavaScript Configuration Bridge
Reads the
monstersearch.wildcardsandmonstersearch.fuzzy_thresholdSystem Settings, formats them, and injects them securely as a JSON object into the Manager's DOM. -
4. JavaScript Parsing Engine (Client-Side)
- Query Extraction: Separates exact matches (quotes), ID searches (
~prefix or raw numbers), inclusion prefixes (e.g.,$,!), and exclusion prefixes (e.g.,-*). - Exact ID Detection: Detects if an ID search contains a trailing space to trigger strict exact matching vs. partial matching.
- Query Extraction: Separates exact matches (quotes), ID searches (
-
5.
Ext.Ajax.requestInterception (Pre-flight)Overrides ExtJS core AJAX methods. When a search action is detected, it parses the query, modifies the payload to request 10,000 results, and appends custom flags (
monster_id,monster_exact_id) for the PHP interceptor to catch. -
6.
Ext.data.ConnectionInterception (Post-flight)- Result Filtering: Receives the massive JSON payload from MODX before it renders on screen.
- Type & ID Validation: Filters out items that don't match the requested prefixes or IDs.
- Fuzzy Logic Application: Applies the Levenshtein distance algorithm to find close matches for text queries, adhering to the
fuzzy_thresholdsetting. - Deduplication & Sorting: Removes duplicate entries and scores results based on exactness, ordering the final array before passing it back to the ExtJS UI for rendering.
Extra Details
- Version: 1.0.2
- Author: Yanni Sanmiguel
- PHP: 7.4+ (8.1+ recommended)
- MODX: 2.8.6+ & 3.x
- Price: Free Extra
- Link to ModX Extras Page
License
MonsterSearch is free to use for personal and commercial projects.
You may install it on unlimited domains, including local and staging environments.
Redistribution, resale, or rebranding of this package is not permitted.
Please keep attribution to the original author.
The software is provided “as is”, without any warranties or guarantees of fitness for a particular purpose.
Use at your own risk.
If you find MonsterSearch useful, consider supporting its continued development.
I have many ideas for new MODX tools and apps — your support helps me keep creating and improving tools for everyone.
Something custom for your site?
These extras are free to use. But the best solution is the one made for you: if you need a high-end MODX website, a system around your business, hosting, a fix, or an extra written for your own project, tell me what you need and I will build it around you.
