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

[TASK] Make page fields to select configurable via configuration for … #85

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

merzilla
Copy link

…TreeMenu

Add the possibility to provide a list of page fields to select for the TreeMenu by setting e.g.:
pageFields = uid,pid,title,slug

  • If the property is not set, it uses "*" for the select fields.
  • If "*" is also in the list, it gets deleted from the list
  • empty values wil be removed, so a type like "uid,,pid,title" is covered

The TreeMenu processor is a fast way to use it e.g. for an RESTful API. In order to create simpler API schemas it´s easier to define which fields are needed from pages. So the schema does not need to provide all ~100 fields if 5-6 are enough.

The change does not touch that nav_title, hasSubpages and subpages will be populated.

@achimfritz
Copy link
Contributor

Hi @merzilla
i think you should use the PopulatePageInformationEvent https://github.com/b13/menus/blob/main/Classes/Event/PopulatePageInformationEvent.php (to not bloat the code)

…TreeMenu

Add the possibility to provide a list of page fields to select for the TreeMenu
by setting e.g.:
pageFields = uid,pid,title,slug

- If the property is not set, it uses "*" for the select fields.
- If "*" is also in the list, it gets deleted from the list
- empty values wil be removed, so a type like "uid,,pid,title" is covered

The TreeMenu processor is a fast way to use it e.g. for an RESTful API.
In order to create simpler API schemas it´s easier to define which fields are needed from pages.
So the schema does not need to provide all ~100 fields if 5-6 are enough.

The change does not touch that nav_title, hasSubpages and subpages will be populated.
@merzilla merzilla force-pushed the make-page-fields-configurable branch from fec9b87 to 45707d2 Compare September 12, 2023 15:22
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.

2 participants