diff --git a/culturefeed_agenda/lib/Drupal/AgendaSearchPage.php b/culturefeed_agenda/lib/Drupal/AgendaSearchPage.php index 42ecbe52..cf19428d 100644 --- a/culturefeed_agenda/lib/Drupal/AgendaSearchPage.php +++ b/culturefeed_agenda/lib/Drupal/AgendaSearchPage.php @@ -306,12 +306,21 @@ public function getPageDescription() { elseif (!empty($query['location'])) { $message .= t(" in @region", array('@region' => $query['location'])); } + elseif (!empty($query['facet']['category_flandersregion_id'][0])) { + $term = culturefeed_search_get_term_translation($query['facet']['category_flandersregion_id'][0]); + $message .= t(" in @region", array('@region' => $term)); + } if (!empty($query['facet']['category_eventtype_id'][0])) { $term = culturefeed_search_get_term_translation($query['facet']['category_eventtype_id'][0]); $message .= t(" of the type @type", array('@type' => $term)); } + elseif (!empty($query['facet']['category_umv_id'][0])) { + $term = culturefeed_search_get_term_translation($query['facet']['category_umv_id'][0]); + $message .= t(" of the type @type", array('@type' => $term)); + } + if (!empty($query['facet']['category_theme_id'][0])) { $term = culturefeed_search_get_term_translation($query['facet']['category_theme_id'][0]); $message .= t(" with theme @theme", array('@theme' => $term)); diff --git a/culturefeed_search_ui/includes/helpers.inc b/culturefeed_search_ui/includes/helpers.inc index 0ba629e6..3bb4dfa1 100644 --- a/culturefeed_search_ui/includes/helpers.inc +++ b/culturefeed_search_ui/includes/helpers.inc @@ -160,6 +160,7 @@ function culturefeed_search_ui_set_noindex_metatag() { $facets = $query['facet']; unset($facets['category_eventtype_id']); unset($facets['category_theme_id']); + unset($facets['category_flandersregion_id']); unset($query['location']); unset($query['regId']); @@ -172,14 +173,48 @@ function culturefeed_search_ui_set_noindex_metatag() { } + // No index is FALSE, if user is filtering on umv category and/or region. + elseif (isset($query['facet']['category_umv_id'])) { + + $facets = $query['facet']; + unset($facets['category_umv_id']); + unset($facets['category_flandersregion_id']); + + unset($query['location']); + unset($query['regId']); + unset($query['facet']); + + // If regId was the only extra facet / parameters, set noindex to false. + if (count($facets) == 0 && count($query) == 0) { + $noindex = FALSE; + } + + } + + // No index is FALSE, if user is filtering on flandersregion Id without additional facets. + elseif (isset($query['facet']['category_flandersregion_id']) && count($query) == 1) { + + $facets = $query['facet']; + unset($facets['category_flandersregion_id']); + + // If flandersregion was the only filter set noindex to false. + if (count($facets) == 0) { + $noindex = FALSE; + } + + } + // No index is FALSE, if user is filtering on region Id without additional facets. - elseif ((isset($query['regId']) || isset($query['location'])) && !isset($query['facet'])) { + elseif (isset($query['regId']) || isset($query['location']) || isset($query['facet']['category_flandersregion_id'])) { + + $facets = $query['facet']; + unset($facets['category_flandersregion_id']); unset($query['location']); unset($query['regId']); - // If regId was the only filter set noindex to false. - if (count($query) == 0) { + // If regId, location or flandersregion was the only filter set noindex to false. + if (count($facets) == 0 && count($query) == 0) { $noindex = FALSE; }