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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Alan D.’s picture

Spending 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.

  • johnv committed 8484f98 on 7.x-1.x authored by Alan D.
    Issue #2508755 by Alan D.: Provide more context to the theming function
    
johnv’s picture

Status: Needs review » Fixed

Thanks Alan,
committed with attribution.

Alan D.’s picture

Ta, one less hack in ours mods tracker :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.