Advanced Custom Fields

Local JSON And Diagnostics

ACF Local JSON helps TemplateX understand your field model while compiling.

Local JSON Location#

TemplateX reads ACF Local JSON from the active theme:

    • group_home.json
    • group_globals.json

When Local JSON is available, TemplateX can warn about likely mistakes and compile known fields more directly.

Field Suggestions#

If a template uses a field that does not exist in the schema, TemplateX can suggest the closest known field:

php
{{ globals }}  <img src="{{ profile_phot }}" alt="">{{ /globals }}

If the saved field is profile_photo, the compiler can warn about the typo.

Scalar Fields Used As Loops#

Local JSON also helps TemplateX warn when a scalar field is used as a paired tag:

php
{{ headline }}  <h2>{{ title }}</h2>{{ /headline }}

Use paired tags for collection fields such as repeaters, galleries, relationships, taxonomy fields, users, post objects, and flexible content.

Use value tags for text, image, link, number, true/false, and other single-value fields.

Better Output#

Known options page slugs compile as direct option scopes.

Known collection fields compile as field collections without the runtime needing to guess whether a tag is a loop or an options scope.