Skip to content
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

use computed fields instead of FieldAPI extra fields #368

Open
joachim-n opened this issue Mar 20, 2024 · 0 comments
Open

use computed fields instead of FieldAPI extra fields #368

joachim-n opened this issue Mar 20, 2024 · 0 comments

Comments

@joachim-n
Copy link

The directory module currently uses FieldAPI extra fields (aka pseudofields) for various things that are output on Directory Channel nodes. This works by declaring items in hook_entity_extra_field_info() and then adding output to the render array in hook_ENTITY_TYPE_view().

This has some drawbacks - for one thing I think it's the cause of #358. It's also quite limited as while you can arrange pseudofields in the display output, there's no way of configuring them.

Using computed fields instead could be a cleaner and more modern way to add output to directory channel nodes. Fields are declared in an entity info hook, and then a field plugin produces the render output. Caching and use of lazy builders for output which is dynamic needs to be considered -- I don't know how the current pseudofields handle this.

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

No branches or pull requests

1 participant