You are here:  » include content to of search page results


include content to of search page results

Submitted by wilkins on Fri, 2015-03-06 16:15 in

Hi David

I know I have asked for this before but I cannot find it on the forum.

What I am doing is using the search results page for specific search terms, very much as a landing page. What I was wondering can content be put at the top of the 1st page of the results page based on the search term, very much like to way content can be place on the product page based on the merchant name.

Thanks

Brent

Submitted by support on Fri, 2015-03-06 16:47

Hello Brent,

I can't either but it's very straight forward to add!

Firstly, create a sub-directory called "searchinfo" containing .html files with a base filename exactly matching the keyword(s) for which it is to be displayed, including spaces, but in all lower case, for example, for additional content to be displayed on page 1 of a search for "Blue Widget" create the file:

searchinfo/blue widget.html

Then in search.php, look for the following code around line 424:

  require("html/banner.php");

...and REPLACE with:

  require("html/banner.php");
  $searchinfo = "searchinfo/".strtolower($q).".html";
  if (file_exists($searchinfo))
  {
    require($searchinfo);
  }

Hope this helps!

Cheers,
David.
--
PriceTapestry.com