Settings
Three MODX system settings, area parser:
| Setting | What it does | Default |
|---|---|---|
pageblocks_elements_path | Directory of file templates for @FILE and file:. | {core_path}App/elements/ |
pageblocks_file_elements_only | Read templates from files only, never from database chunks. | false |
pageblocks_fenom_auto_reload | Recompile a template when its file changes. | true |
The path is absolute, not "relative to core/"
The value goes into a filesystem path verbatim, so it has to be absolute. MODX expands the {core_path}, {base_path} and {assets_path} placeholders itself — that is what the {core_path}App/elements/ default relies on. Writing App/elements/ does not work: it resolves against the current working directory, the directory is not found, and MODX logs [Fenom Init] Template directory does not exist.
pageblocks_file_elements_only
Turning it on does not merely "speed things up" — it changes how a template name is parsed:
- an unprefixed name is read as
file:, not as a MODX chunk; - the
template:provider is not registered at all.
So {include 'header'} starts looking for header.tpl on disk. This is for projects that keep elements in git rather than in the database.
pageblocks_fenom_auto_reload
Turning it off in production only makes sense where templates do not change between deploys: with it off, editing a .tpl has no effect until the cache is cleared. In pbFenom the freshness check is cheap — realpath() was taken off the hot path, and a page with {extends} plus twenty {include} costs 7.6 µs against 4.5 µs without auto reload — so there is not much to save here.
Fixed in code
The rest comes from View::init() and is not configurable:
| Option | Value | Why |
|---|---|---|
| compile directory | core/cache/pbfenom/ | cleared together with the MODX cache |
force_include | true | {include} is compiled into the parent's body |
force_verify | true | an undeclared variable is an empty string, not a warning |
force_compile, disable_cache | false | the artifact is written to disk and reused |
disable_native_funcs | not set | see PHP functions |
Clearing the cache
Compiled templates live in core/cache/pbfenom/. Clearing the cache from the MODX manager runs:
View::clearCache();Clearing the directory by hand is not needed — with auto_reload on, editing a file already triggers a recompile.