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.
Currently, the output of the views display plugin into popups or tooltips has hard-coded html:
$descriptions = array();
foreach ($record as $k => $v) {
foreach ($handlers as $hid => $handler) {
$rendered_record[$handler->field_alias] = $handler->advanced_render($v);
}
$item = '';
if ($data_source['name_field']) {
$name_field = $fields[$data_source['name_field']]['field_alias'];
$item .= "<h2 class='point-title'>". $rendered_record[$name_field] ."</h2>";
}
if ($data_source['description_field']) {
$description_field = $fields[$data_source['description_field']]['field_alias'];
$item .= "<div class='point-content'>". $rendered_record[$description_field] ."</div>";
}
$descriptions[] = $item;
}
This needs to go into a theme function.
Comment | File | Size | Author |
---|---|---|---|
#5 | 736576-openlayers-views-group-theme_v02.patch | 4.48 KB | zzolo |
#2 | 736576-openlayers-views-group-theme.patch | 4.34 KB | zzolo |
Comments
Comment #1
zzolo CreditAttribution: zzolo commentedPlease note that this is only the case for grouped output.
Comment #2
zzolo CreditAttribution: zzolo commentedHere is a patch. I dont have time to fully test (as there is a fair amount of work in setting it up to test)
It's fairly straightforward. One thing I did change was the CSS class names to be more Drupal friendly and to use consistent naming. @tmcw, I have a feeling that Managing News actually uses these selectors, but its just a guess?
Comment #3
tmcw CreditAttribution: tmcw commentedI'd assume other sites use those classes as well. Just include both classes.
Comment #4
tmcw CreditAttribution: tmcw commentedThis patch is missing a semicolon in the theme function, so it breaks Drupal at the bootstrap level. Please fix, and then retest, and then I think that this will be commit'able.
Comment #5
zzolo CreditAttribution: zzolo commentedUpdated patch with semicolon and current branch. Don't have much time again to set it up, so maybe someone already has it set up.
Comment #6
zzolo CreditAttribution: zzolo commentedComitted:
http://drupal.org/cvs?commit=376098
Comment #7
tmcw CreditAttribution: tmcw commentedRe: #3, I've added the other class in. Otherwise this needs a changelog entry. Unannounced, unnoted compatibility breakages are not all right.