Skip to content

Commit

Permalink
add noindex, nofollow on review form
Browse files Browse the repository at this point in the history
  • Loading branch information
lukdens committed Sep 19, 2013
1 parent 3867693 commit bf8cbeb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion culturefeed_search_ui/includes/helpers.inc
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function culturefeed_search_ui_set_noindex_metatag() {
),
);

drupal_add_html_head($element, 'nofollow');
drupal_add_html_head($element, 'robots');
}

}
Expand Down
10 changes: 8 additions & 2 deletions culturefeed_ui/culturefeed_ui.helpers.inc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
function culturefeed_ui_set_canonical_and_noindex() {
$canonical = FALSE;
$noindex = FALSE;
$nofollow = FALSE;

if (arg(0) == 'culturefeed') {
if (arg(1) == 'activities' && arg(2) == 'recent') {
Expand All @@ -16,17 +17,22 @@ function culturefeed_ui_set_canonical_and_noindex() {
}
}

if (arg(0) == 'review') {
$noindex = TRUE;
$nofollow = TRUE;
}

// Add the "noindex, follow" meta tag if needed.
if ($noindex) {
$element = array(
'#tag' => 'meta',
'#attributes' => array(
'name' => 'robots',
'content' => 'noindex, follow',
'content' => 'noindex, ' . ($nofollow ? 'nofollow' : 'follow'),
),
);

drupal_add_html_head($element, 'nofollow');
drupal_add_html_head($element, 'robots');
}

// Add the rel="canonical" tag if needed.
Expand Down

0 comments on commit bf8cbeb

Please sign in to comment.