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.
I've been looking around in all the docs and in the message queue and can't seem to find how to theme a field in my popup.
I have my map with markers on it, simple. My marker popups use the title field, but I have some special theming needed for the title field, but the view template for the that field is ignored. I thought I might have needed to implement theme_openlayers_views_feature_style() but that didn't change anything rendered on the map.
What am I missing?
Regards,
Eric
Comments
Comment #1
phayes CreditAttribution: phayes commented"view template for the that field is ignored" - this sounds like a bug.
Comment #2
phayes CreditAttribution: phayes commentedComment #3
emackn CreditAttribution: emackn commentedI did notice that it does find the openlayers-views* templates, but none of the others as far as I can tell.
Comment #4
emackn CreditAttribution: emackn commentedAt the end of render(), (openlayers_views_style_map.inc:456), $this->theme_functions() is only returning
Comment #5
zzolo CreditAttribution: zzolo commentedCan anyone else confirm that the OL Views plugin is not using the field theme functions?
Comment #6
zzolo CreditAttribution: zzolo commentedHere's the thing. OpenLayers module provides a style plugin which does provide the usual theme functions, as listed above.
But, for fields, these are handled by field handlers. For instance, outputting the theme functions for a field:
So, you should be able to theme the field just like in a any other View.
For popups, the field or row gets rendered like any normal View part, but we stick some custom HTML around it. In theory this should be in a theme function, but it is HTML that makes the popups behave correctly.