diff --git a/views_pdf_plugin_style_unformatted.inc b/views_pdf_plugin_style_unformatted.inc index b306e54..d4dcfe6 100644 --- a/views_pdf_plugin_style_unformatted.inc +++ b/views_pdf_plugin_style_unformatted.inc @@ -50,6 +50,10 @@ class views_pdf_plugin_style_unformatted extends views_plugin_style { if(isset($this->row_plugin->options['formats'][$field_id])) { $options = $this->row_plugin->options['formats'][$field_id]; } + + // Add a field in $options to specify that this is a group title + // and that it should always be printed, even if the field is excluded. + $options['group_title'] = TRUE; $this->view->pdf->drawContent($set['group'], $options, $this->view); } diff --git a/views_pdf_template.php b/views_pdf_template.php index 2443ca8..8fef9a6 100644 --- a/views_pdf_template.php +++ b/views_pdf_template.php @@ -421,7 +421,7 @@ class PdfTemplate extends FPDI { return; } - if (empty($key) || !empty($view->field[$key]->options['exclude']) || (empty($content) && $view->field[$key]->options['hide_empty'])) { + if (empty($options['group_title']) && (empty($key) || !empty($view->field[$key]->options['exclude']) || (empty($content) && $view->field[$key]->options['hide_empty']))) { return ''; }