You are here

blog.page_title.inc in Page Title 7.2

Same filename and directory in other branches
  1. 8.2 modules/blog.page_title.inc
  2. 6.2 modules/blog.page_title.inc

Blog implementations of the page title hooks

File

modules/blog.page_title.inc
View source
<?php

/**
 * @file
 * Blog implementations of the page title hooks
 */

/**
 * Implements hook_page_title_alter().
 */
function blog_page_title_alter(&$title) {
  $menu_item = menu_get_item();

  // If we're looking at a users blog page, get the user title
  if (!strncmp($menu_item['path'], 'blog/%', 6) && ($user = menu_get_object('user_uid_optional'))) {
    if (variable_get('page_title_blog_showfield', 0) && ($blog_title = page_title_load_title(arg(1), 'user'))) {
      $title = $blog_title;
    }
  }
}

/**
 * Implements hook_page_title_pattern_alter().
 */
function blog_page_title_pattern_alter(&$pattern, &$types) {
  $menu_item = menu_get_item();
  if (!strncmp($menu_item['path'], 'blog/%', 6) && ($user = menu_get_object('user_uid_optional'))) {
    $types['user'] = $user;
    $pattern = variable_get('page_title_blog', '');
  }
}

/**
 * Implements hook_page_title_settings().
 */
function blog_page_title_settings() {
  return array(
    'page_title_blog' => array(
      'label' => 'Blog Homepage',
      'scopes' => array(
        'global',
        'user',
      ),
      'show field' => FALSE,
      'description' => 'This pattern will be used for a users blog page (ie <code>/blog/1</code>)',
    ),
  );
}

Functions

Namesort descending Description
blog_page_title_alter Implements hook_page_title_alter().
blog_page_title_pattern_alter Implements hook_page_title_pattern_alter().
blog_page_title_settings Implements hook_page_title_settings().