Skip to content

Generated fields #17426

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Jun 15, 2025
Merged

Generated fields #17426

merged 18 commits into from
Jun 15, 2025

Conversation

brandonkelly
Copy link
Member

@brandonkelly brandonkelly commented Jun 11, 2025

Description

Adds the ability to define “generated fields” alongside field layouts. Generated fields are special element values that are generated on element save, based on a given Twig template.

A “Generated Fields” table, with an “Alt” field defined.

Generated fields can be accessed just like custom fields from an element, via their handle, both within Twig and GraphQL. They also get their own element query and GraphQL query arguments, condition rules, and card attributes.

# Conflicts:
#	src/web/assets/cp/dist/cp.js
#	src/web/assets/cp/dist/cp.js.map
#	src/web/assets/garnish/dist/garnish.js.map
# Conflicts:
#	src/web/assets/cp/dist/cp.js
#	src/web/assets/cp/dist/cp.js.map
…3-cms-1424-generated-fields

# Conflicts:
#	src/web/assets/cp/dist/cp.js
#	src/web/assets/cp/dist/cp.js.map
Copy link

linear bot commented Jun 11, 2025

@thupsi
Copy link

thupsi commented Jun 11, 2025

Nice! Would it be possible for generated fields to be selectable in the Card Layout Editor? It's the one feature of the Preparse plugin I would miss!

@khalwat
Copy link
Contributor

khalwat commented Jun 11, 2025

https://github.com/nystudio107/craft-code-editor :)

…ds' into feature/03-cms-1424-generated-fields

# Conflicts:
#	src/web/assets/cp/dist/cp.js
#	src/web/assets/cp/dist/cp.js.map
#	src/web/assets/garnish/dist/garnish.js.map
…ds' into feature/03-cms-1424-generated-fields

# Conflicts:
#	src/translations/en/app.php
# Conflicts:
#	src/web/assets/cp/dist/cp.js
#	src/web/assets/cp/dist/cp.js.map
@brandonkelly
Copy link
Member Author

Nice! Would it be possible for generated fields to be selectable in the Card Layout Editor? It's the one feature of the Preparse plugin I would miss!

Yep, added that today :)

[ci skip]
@brandonkelly brandonkelly merged commit 5f977da into 5.8 Jun 15, 2025
@brandonkelly brandonkelly deleted the feature/cms-1424-generated-fields branch June 15, 2025 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants