OrchardCMS / Orchard

Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform.
https://orchardproject.net
BSD 3-Clause "New" or "Revised" License
2.37k stars 1.12k forks source link

Display option override in DateTimeField #8728

Open AgostiniAlessandro opened 11 months ago

AgostiniAlessandro commented 11 months ago

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 commented 11 months ago

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 commented 5 months ago

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?