Skip to content

[5.x] FR: More convenient way to access custom fields in JSON column for advanced queries #14557

Closed Answered by brandonkelly
wsydney76 asked this question in Ideas
Discussion options

You must be logged in to vote

Just added a new fieldValueSql() Twig function for the next release.

Custom fields can be added to more than just entry types (volumes, global sets, the user field layout, etc.), so the first argument accepts a FieldLayoutProviderInterface instance (e.g. EntryType) rather than an entry type handle, and I also added a new entryType() method to fetch the entry type:

{% set lastSeason = filmQuery.max(fieldValueSql(entryType('film'), 'season')) %}

(7c97465)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@brandonkelly
Comment options

Answer selected by brandonkelly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants