You are here:  » Custom Pages with Product Results


Custom Pages with Product Results

Submitted by bat on Fri, 2018-06-01 20:29 in

Hi David,
I can't find the original topic but I wanted to know please for version 16/10A how would you go about creating a custom page with search results?
I have ones from my previous versions but they're not working.

Example of the code I have is:

<?php
  $_GET["q"] = "surround sound system";
  $header["title"] = "Surround Sound Systems for Sale | Electrical Shop";
  $header["meta"]["description"] = "Buy surround sound systems from a variety of manufacturers.";
  $customHTML = "Surround Sound Systems for your home. Etc, Etc. ";
  require("search.php");
?>

but when I upload that to the server and visit it in the browser, I get "This site can’t be reached".

Thank you!

Submitted by support on Sat, 2018-06-02 07:04

Hi,

What I would suggest would be to follow the instructions in this comment to create a new file called "searchcode.php".

Then, to make a custom page, based on example.php from the distribution, saved as surround-sound.php:

<?php
  require("includes/common.php");
  $header["title"] = "Surround Sound Systems for Sale | Electrical Shop";
  $header["meta"]["description"] = "Buy surround sound systems from a variety of manufacturers.";
  $header["meta"]["keywords"] = "surround sound";
  require("html/header.php");
  require("html/menu.php");
  require("html/searchform.php");
  $banner["breadcrumbs"] = array();
  $banner["breadcrumbs"][] = array("title"=>"Surround Sound","href"=>$config_baseHREF."surround-sound.php");
  require("html/banner.php");
?>
<div class='row'>
  <div class='small-12 columns'>
    <p>Surround Sound Systems for your home. Etc, Etc. </p>
  </div>
</div>
<?php
  $_GET["q"] = "surround sound system";
  require("searchcode.php");
  require("html/footer.php");
?>

Cheers,
David.
--
PriceTapestry.com