Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/UIV-1397'
Browse files Browse the repository at this point in the history
  • Loading branch information
lukdens committed Jul 16, 2015
2 parents 43bdda8 + fb76647 commit b73c057
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 3 deletions.
9 changes: 9 additions & 0 deletions culturefeed_agenda/lib/Drupal/AgendaSearchPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
41 changes: 38 additions & 3 deletions culturefeed_search_ui/includes/helpers.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand All @@ -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;
}

Expand Down

0 comments on commit b73c057

Please sign in to comment.