- Issue created by @devitate
- π³π±Netherlands johnv
Can you explain your use case in more detail?
I guess you do not mean the default field value?I think a 'template' entity could be maintained, and a hook can retrieve that upon creating the display view.
Is that in line with your view? - π§πͺBelgium tim-diels Belgium π§πͺ
I was looking at the same functionality and it would definitely be a nice addition.
Let me explain our use case:
A website has multiple stores and are managed with office hours. But to not have to set a vacation period per store, it would be nice to have like a global exception period that can be added and is added to all stores. For example Christmas period or construction leave. And that you can choose per store to apply the global exception (as sometimes you can have different construction leave in one country)
- π§πͺBelgium tim-diels Belgium π§πͺ
For now I overwritten the office_hours_preprocess_office_hours() and hardcoded get the references of a vocabulary. If this is something you are willing to review, I could for example create it differently and allow to select a entity reference field on the field formatter to allow to select a vocabulary and display them within the exceptions on rendering. Or even provide a field setting so it is automatically added to the widget?
I did not yet do this because of budget reasons on our project, but I'm willing to look into this further but first need feedback from a maintainer (or someone else) to see what direction we would be willing to go.All suggestions are welcome.
- π³π±Netherlands johnv
I'd like to see your code.
I am not that much into theming, and tend to put everything in php.So you store the defaults in a vocabulary. That is smart.
And adding the vocabulary to the formatter makes the entity free from those general settings, since it is only in the display.
And using the season feature, the global exception days can be on and off. Nice.The latest version uses some new technique to sort the days. You do that in your preprocessing?
- Status changed to Closed: works as designed
10 months ago 4:20pm 28 February 2024 - π³π±Netherlands johnv
I guess this can also be done with some small code via β¨ Formatter: Add Event to allow other modules to modify values Fixed .
The common data can be taken from any other object/entity/taxonomy term.
Feel free to re-open if you have alternative solutions.