Created
August 1, 2012 19:10
-
-
Save jpustula/3229868 to your computer and use it in GitHub Desktop.
Changes in Page Tile 2.7 module for Drupal 7. Repairs pager suffix pattern.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- old/page_title.module 2012-05-09 11:28:00.000000000 +0200 | |
+++ new/page_title.module 2012-08-01 20:43:49.032958200 +0200 | |
@@ -601,19 +601,23 @@ | |
if (is_null($title)) { | |
$types = array('global' => NULL); | |
- | |
+ $status = drupal_get_http_header("status"); | |
+ | |
// Allow hook_page_title_pattern_alter() to modify the pattern and tokens | |
drupal_alter('page_title_pattern', $page_title_pattern, $types); | |
- | |
+ | |
+ // Override the pattern for pages with a pager on them | |
+ if (isset($_REQUEST['page']) && ($status != '404 Not Found')) | |
+ { | |
+ $page_title_pattern = variable_get('page_title_pager_pattern', ''); | |
+ } | |
+ | |
// If pattern is empty (either if the type is not overridable or simply not set) fallback to the default pattern | |
if (empty($page_title_pattern)) { | |
$settings = page_title_get_settings(); | |
$page_title_pattern = variable_get('page_title_default', $settings['page_title_default']['default']); | |
} | |
- | |
- // Append the pattern for pages with a pager on them | |
- $page_title_pattern .= isset($_REQUEST['page']) ? variable_get('page_title_pager_pattern', '') : ''; | |
- | |
+ | |
// Apply token patterns using token_replace | |
$title = token_replace($page_title_pattern, $types, array('sanitize' => FALSE)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment