You are here:  » Backport Instructions - Unique search result page titles

Support Forum



Backport Instructions - Unique search result page titles

Submitted by support on Tue, 2011-01-11 12:04 in

The latest distribution (12/10A) includes a modification to ensure that all search results page titles are unique across all combinations of sort order and page number. To add this title variation to an existing site, look for the following code around line 260 of search.php:

    $header["title"] = htmlentities($q,ENT_QUOTES,$config_charset);

...and REPLACE with:

    $header["title"] = htmlentities($q,ENT_QUOTES,$config_charset);
    if ($sort <> "relevance")
    {
      $titleSort = array(
        "relevance" => translate("Relevance"),
        "rating" => translate("Rating"),
        "priceAsc" => translate("Price: Low to High"),
        "priceDesc" => translate("Price: High to Low"));
      $header["title"] .= " | ".translate("By")." ".$titleSort[$sort];
    }
    if ($page > 1)
    {
      $header["title"] .= " | ".translate("Page")." ".$page;
    }

With this in place, the first page of results, sorted by relevance (the default) remains as before, but further information is then added when changing the sort order or navigating to subsequent pages.