You are here:  » Meta Title for Search Page


Meta Title for Search Page

Submitted by technoarenasol on Tue, 2013-05-07 09:58 in

Hi David

How can possible to give title meta according to brand,category in search page

Example :

Samsung Laptop Price - Page 1 (brand,category)
All Laptop Price - Page 1 (all brand,Category)
Nokia Mobile Price - page 2 (brand,Category)

Thanks
Amin

Submitted by support on Tue, 2013-05-07 11:14

Hi Amin,

Sure - look for where the title is currently set by the following code around line 320:

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

...and REPLACE with something like this:

  if (isset($parts[1]) && $parts[1])
  {
    $header["title"] = $merchantFilter." ".$categoryFilter." ".$brandFilter;
    if (!trim($header["title"]))
    {
      $header["title"] = "All ";
    }
    $header["title"] .= htmlspecialchars($parts[1])." Price";
  }
  else
  {
    $header["title"] = htmlentities($q,ENT_QUOTES,$config_charset);
  }

(sort / page number are added via existing code - to prevent duplicate title issues)

Cheers,
David.
--
PriceTapestry.com

Submitted by technoarenasol on Wed, 2013-05-08 09:36

technoarenasol

HI David ..This trick not working

Actually want on this page (Example)

http://example.com/mobile/search.php?q=%3A&categoryFilter[]=Mobile+Phones (title = "All Mobile Phones")
http://example.com/mobile/search.php?q=%3A&categoryFilter[]=Mobile+Phones&brandFilter[]=Nokia (Title="Nokia Mobile Phone")

Thanks

Submitted by support on Wed, 2013-05-08 11:02

Hi Amin,

I forgot that you're using multi-select filters, so have a go with the following simpler version using PHP's implode() function as the replacement:

  if (count($categoryFilter))
  {
    if (count($brandFilter))
    {
      $title = "All";
    }
    else
    {
      $title = implode(" ",$brandFilter);
    }
    $title .= " ".implode(" ",$categoryFilter);
    $header["title"] .= htmlspecialchars($title);
  }
  else
  {
    $header["title"] = htmlentities($q,ENT_QUOTES,$config_charset);
  }

Cheers,
David.
--
PriceTapestry.com

Submitted by technoarenasol on Wed, 2013-05-08 11:36

technoarenasol

Hi David..

Not working properly ....

title of every search page :

<title>: | By </title>

Submitted by support on Wed, 2013-05-08 16:31

Hi Amin,

Please could you email me your latest search.php, I think the modifications have become merged I'll check it all out for you...

Thanks,
David.
--
PriceTapestry.com