If e.g. a product (stored as a block on a page) should be featured on the website for a certain period of time (something like the 25th of January from 1pm to 8pm), then the content manager has to manually add and delete the block exactly at these times.
The solution proposed at #4964 would already help with that, because then the content manager would only have to change a toggler, which would be less work than creating an entire block. However, the content manager still has to make this change manually.
Therefore we would suggest to also add another option, which allows to define at which times the block should be shown. What comes to mind are the following options (ordered by my personal priority):
I really like this idea. Would it be an option to extend this to snippets? Many of our customers have elements like opening hours of stores integrated in their pages. Before and after every (national) holiday content managers have to change these blocks accordingly. It would be great to have such timed blocks/snippets that automatically display additional information like "we're closed this saturday afternoon".
Sounds like the yearly option I've sketched out would be needed for this as well :grimacing: But then I would say for yearly you can only select two date time fields without a year? Maybe we also need to allow to set multiple time rules on a single block, so that a block can be shown at two different times of the year. Having multiple time restrictions might also change how we implement the monthly and weekly options from a UX perspective.
And yeah, this will be done on a content type level, so this will be usable in pages and snippets (and probably also articles).
So there are two open questions here:
I for sure have this on my list as a requirement, I wanted to solve it with twig filters - but getting a proper official integration on this would be super awesome! :rocket:
I am not really after "repeating elements" but rather something like "Put out this block only tomorrow for this and this marketing campaign thing". ;)
@kortwotze And which of the mentioned options (daily, weekly, monthly, yearly, ...) would make sense in your opinion?
@danrot I am fully contempt with a start/end DateTime option which defaults to "invisible if invalid configuration" :)
Edit: Thinking of @DavidFeller's usecase - why not have two modes? Start/End and "Coupled to a calender / configured set of days per block". Though I would actually say that the first option should be enough. National holidays do not come unexpected and I think it should be okay to ask of creators/marketing people to plan ahead and be like "Next week is national holiday x, I want this block to show on that day".
About the opening hours thing: Why not do it the same way? Its national holiday time, so I enable a block that shows my extended opening ours only for that day.
I kind of think that making it repeatable will become more of a problem in terms of managing the complexity of a page, if there are many dependencies between blocks (sulu-syntactical and content-semantical).
Even if I believe a basic implementation would be enough to start there might be tools out there that are already providing a solution or at least a good idea what to do.
What about something like this?
https://www.npmjs.com/package/crontab-ui
Still this is not very Content Manager friendly as it is very close to cron.
Or UI thingies like this?
https://javascript.daypilot.org/scheduler/
Probably totally oversized but that drag and drop scheduling seems nice.
@kfrohwein As you already said, these options feel a bit like overkill... And the UI is not the only problem, if we add more complexity in configuring, it will also result on more complexity in the website rendering and caching part.
@danrot Still cron, even if you just use it as data format, might be an interesting idea. As far as I can see it is a standard and has a symfony package as implementation. That could cut down the time that is needed for development.
Very exciting feature.
In my current project we could use that very well!
In our case, a datetime picker with date and time how long the the block should be active would be completely sufficient. (for example since 04.02.2020 14:30)
However, I am also very interested in other options, such as defining times in which it should be active. e.g. only from 8pm - 12pm
I think the best option is to develop the first one with two datetime fileds and maybe later add options to repeat over time like google calendar or similar
We have decided that the first functionalities we are implementing are:
Most helpful comment
We have decided that the first functionalities we are implementing are: