Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Basically allow users to do what they want here, but without the context, you don't actually know what OH field instance you are theming.
Passing all fields in via a context array element, albeit on the entity type, entity, instance and language are really needed.
Comment | File | Size | Author |
---|---|---|---|
#1 | office-hours-custom-day-display-2.png | 11.68 KB | Alan D. |
#1 | office-hours-custom-day-display.png | 10.81 KB | Alan D. |
office_hours-no-issue-more-context-for-theming-function.patch | 705 bytes | Alan D. | |
Comments
Comment #1
Alan D. CreditAttribution: Alan D. commentedSpending way too much time on this where some static text would have done... following on from #1743366: [Season Meta] Add "Seasonal Hours / Duration" feature
Using the same setup on a singular bean with the field, rendering this with a new view mode and detecting this in the custom theme function:
At 4:55pm
At 5:05pm
I have actually created a custom non-caching block that loads and displays the bean as above, then conditionally loads one of two other blocks with contact information specific to the time of the day too.
Comment #3
johnvThanks Alan,
committed with attribution.
Comment #4
Alan D. CreditAttribution: Alan D. commentedTa, one less hack in ours mods tracker :)