How can I change title of archive page from "Archive - Dec" to "Archive - December"?
Thanks.

Comments

Susurrus’s picture

Component: Miscellaneous » Code
Category: feature » support

Currently the way to change the title is at the top of archive_page() where the title is being set. It grabs the month values from a function called _get_month_names(). You should remove this call from the top of archive_page() and replace it with an array of the month names you would like to use (be sure to leave the first element in the array an empty string!).

SolomonGifford’s picture

Category: support » feature

May I suggest a different solution?

I would like to change the title based on other scenarios. The point is, the title should be themed.

Change the lines:

// Set the page title
    $title = t('Archives');
    $month_names = _get_month_names();
    if ($day) {
      $title .= ' - '. t($month_names[$month]) .' '. $day .', '. $year;
    }
    else if ($month) {
      $title .= ' - '. t($month_names[$month]) .' '. $year;
    }
    else if ($year) {
      $title .= ' - '. $year;
    }
    if ($type != 'all') {
      $title .= ' - '. $type;
    }

to:

$title=theme('archive_title', $month, $day, $year, $type);

Then add the function:

function theme_archive_title($month, $day, $year, $type) {
    // Set the page title
    $title = t('Archives');
    $month_names = _get_month_names();
    if ($day) {
      $title .= ' - '. t($month_names[$month]) .' '. $day .', '. $year;
    }
    else if ($month) {
      $title .= ' - '. t($month_names[$month]) .' '. $year;
    }
    else if ($year) {
      $title .= ' - '. $year;
    }
    if ($type != 'all') {
      $title .= ' - '. $type;
    }
    return $title;
}

This allows the theme to override the title!

Susurrus’s picture

This's fixed in the development branch.

Susurrus’s picture

Status: Active » Fixed
SolomonGifford’s picture

Thanks Susurrus!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.