If you are comfortable with theme templates, you could do this by modifying the Style output, eg:
for your View. Here I created a quick View called for-da-grouping
like this:
which has the node title and then two fields, country and province which are excluded from display. I am sorting first on Country and then within that Province, so, given the same information in your example, this produces:
But, if you add some logic to your new Views template:
<?php
/**
* @file views-view-unformatted.tpl.php
* Default simple view template to display a list of rows.
*
* @ingroup views_templates
*/
$country='';
$province='';
/*
drupal_set_message('<pre>' . print_r($view->result[0], TRUE) . '</pre>');
[node_title] => object 1
[nid] => 660
[node_language] =>
[node_data_field_da_country_field_da_country_value] => Canada
[node_type] => page
[node_vid] => 660
[node_data_field_da_country_field_da_province_value] => Ontario
*/
?>
<?php if (!empty($title)): ?>
<h3><?php print $title; ?></h3>
<?php endif; ?>
<?php foreach ($rows as $id => $row): ?>
<?php if ($view->result[$id]->node_data_field_da_country_field_da_country_value!=$country): ?>
<div class="country-group-title">
<?php print check_plain($view->result[$id]->node_data_field_da_country_field_da_country_value); ?>
<?php $country=$view->result[$id]->node_data_field_da_country_field_da_country_value; ?>
</div>
<?php endif; ?>
<?php if ($view->result[$id]->node_data_field_da_country_field_da_province_value!=$province): ?>
<div class="province-group-title">
<?php print check_plain($view->result[$id]->node_data_field_da_country_field_da_province_value); ?>
<?php $province=$view->result[$id]->node_data_field_da_country_field_da_province_value; ?>
</div>
<?php endif; ?>
<div class="<?php print $classes[$id]; ?>">
<?php print $row; ?>
</div>
<?php endforeach; ?>
You can get:
Now, things to look at in specific:
You need to sort your View first by country and then by province so the data is in the right order to begin with.
You need to know your Views results, they are stored in $view->result
and you can get what you need out of looking at $view->result[0]
and in my view, my two fields I want to group on are called node_data_field_da_country_field_da_country_value
and node_data_field_da_country_field_da_province_value
but yours are most probably going to be different but the logic is still the same: Only display the country and/or province if it has changed since the last time it was displayed.
Add some css to your new group headings and you should be all set.
If not, you can investigate the Views Field Module and so forth mentioned in https://stackoverflow.com/questions/9015500/how-to-group-by-more-than-one-field-in-drupal-view for alternative methods.