Commit 4bf5e734 authored by Nicholas Thompson's avatar Nicholas Thompson
Browse files

Addition to allow for Pager pattern title appending (eg, add Page 1, 2, 3 onto Views Listings)

parent 988b636b
......@@ -96,6 +96,13 @@ function page_title_admin_settings() {
}
$form['page_title_pager_pattern'] = array(
'#type' => 'textfield',
'#title' => t('Pattern for pages that contain a pager'),
'#default_value' => variable_get('page_title_pager_pattern', ''),
'#description' => t('This pattern will be appended to a page title for any given page with a pager on it'),
);
// Add the token help to a collapsed fieldset at the end of the configuration page.
$form['token_help'] = array(
'#type' => 'fieldset',
......
......@@ -349,6 +349,10 @@ function page_title_page_get_title() {
$page_title_pattern = variable_get('page_title_default', '[page-title] | [site-slogan]');
}
// Append the pattern for pages with a pager on them
$page_title_pattern .= isset($_REQUEST['page']) ? variable_get('page_title_pager_pattern', '') : '';
// Applu the token patterns using the one-level replacer (frontpage is only "global" scope)
$title = token_replace($page_title_pattern);
}
// Otherwise this is a non-frontpage page title.
......@@ -379,6 +383,9 @@ function page_title_page_get_title() {
$page_title_pattern = variable_get('page_title_default', '[page-title] | [site-name]');
}
// 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_multiple
$title = token_replace_multiple($page_title_pattern, $types);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment