Skip to content

Repository files navigation

pdoTools

pdoTools is a set of everyday MODX Revolution snippets plus a small library that keeps them fast. Queries are built with xPDO and run through PDO. Elements can live in the database or in files. Tickets and miniShop2 use it.

Documentation: docs.modx.pro/components/pdotools

Advantages

Every pdoTools snippet shares the same core:

  • Database work goes through PDO. xPDO objects are created only when needed.
  • Simple placeholders in chunks are preprocessed so the MODX parser only handles complex tags.
  • TV parameters are sorted, prepared, processed, and output correctly.
  • Chunk code can sit inline in the snippet call, in a normal chunk, or in a static file (@FILE, @INLINE, @TEMPLATE).
  • Fast placeholders wrap a value in tags only when it is not empty (covers many isempty-style cases).
  • A timed work log for debugging bottlenecks.

Queries can target any tables, with joins and conditions. Pagination stays compatible with getPage via pdoPage. From 2.0 the package includes the Fenom template engine.

Compared with stock MODX helpers:

  • pdoTools::getChunk() processes placeholders faster than modX::getChunk().
  • pdoTools::runSnippet() is faster and more powerful than modX::runSnippet().

These snippets usually run faster when you select more fields in a single query.

Composition

Snippets

Snippet Role
pdoResources Resource lists (parameter-compatible replacement for getResources)
pdoMenu Menus (Wayfinder replacement)
pdoPage Pagination (getPage replacement)
pdoCrumbs Breadcrumbs (BreadCrumb replacement)
pdoUsers Users, with role and group filters
pdoSitemap Sitemap generation (GoogleSiteMap replacement)
pdoNeighbors Links to neighboring resources
pdoField Any resource field (getResourceField / UltimateParent replacement)
pdoTitle Page title helper
pdoArchive Archive listings by date

Classes

Class Docs
pdoTools Core helpers (getChunk, runSnippet, caching, …)
pdoFetch Query builder and PDO fetch layer
pdoParser Parser integration (Fenom / FastField tags)

More documentation

Links

About

Library for creating fast snippets for MODX Revolution.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

95 stars

Watchers

16 watching

Forks

Releases

Packages

Used by

Contributors

Languages