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

Display option override in DateTimeField #8728

Open
AgostiniAlessandro opened this issue Oct 30, 2023 · 4 comments
Open

Display option override in DateTimeField #8728

AgostiniAlessandro opened this issue Oct 30, 2023 · 4 comments

Comments

@AgostiniAlessandro
Copy link
Contributor

Right now it’s possibile to configure a DateTimeField so that it allows the user to specify only the Date, only the Time or both.
In some cases it would be useful to allow the user to override this setting for a specific content.

For example and Event content type may contain a DateTimeField representing its starting date/time so in the field's Display option will be set to DateTime in content definition but the user may want to only show the starting date for a particular event and right now this is not possible.
By allowing the user to override the Display option value in the content we allow him to decide wether he wants the starting date or time to be shown for a particular event without having to modify the setting for the other contents of the same type.

@sebastienros
Copy link
Member

I think this should be a different field on the content type that would drive how the content is rendered. Otherwise we would provide all the field options to all content items.

Here just add "Display Time" as a boolean field, and use it in your theme/template to decide how to render it.

@BenedekFarkas BenedekFarkas linked a pull request Apr 15, 2024 that will close this issue
@BenedekFarkas
Copy link
Member

Here just add "Display Time" as a boolean field, and use it in your theme/template to decide how to render it.

You're saying that this should only be a type-level, but not item-level setting, right?

@BenedekFarkas
Copy link
Member

@sebastienros I tested this (including my suggested changes under the PR) and seems to work correctly. I don't mind adding this, since it's opt-in.

@sebastienros
Copy link
Member

I still think this should be a custom field on this type. You can still set the setting at the part level. You add an emumartion field to your types, and use this field to drive the UI in the template of this type. One template to update to get the same result.

The other thing we discussed is that if we'd be to accept it we would then accept it also for any setting of any fields.

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 a pull request may close this issue.

3 participants