Agnostic Fetch

The code to fetch the elements from a Craft Element Query is different when the elements have been eager-loaded. For example, to get the first element of a non eagerly loaded field,, but for an eagerly loaded field, someField[0] (and that doesn't even get into the error checking). With Agnostic Fetch, you can do someField | one (or one(someField) or

The Agnostic Fetch functions are available as twig filters, as twig functions, and as craft variables.


Package Name

To install this plugin, search for its package name on the Plugin Store and click “Install”.


  • Version 2.0.4
  • Last Update 2/4/2019
  • Active Installs 158
  • Compatibility Craft 3
  • License MIT
  • Categories Templating, Development

Report an issue