You are here:  » Category results

Support Forum



Category results

Submitted by JasonG on Tue, 2012-11-20 18:24 in

Hi David,

I was wondering if you had any code written already to achieve something

If you look at this page: {link saved}

We have a blue bar that has the text "Product search results for category:Dog Treats And Chews: (showing 1 to 10 of 969)"

I would like to change this to "Product search results (showing 1 to 10 of 969)"

Then above the Blue bar have an H1 saying Dog Treats And Chews which could be picked up from the database somewhere (I think)!

Thanks
Stuart

Submitted by support on Wed, 2012-11-21 09:18

Hi Stuart,

Sure - best thing to do is probably add $banner["h1"] support. Firstly, in search.php look for the following code around line 277:

$banner["h2"] = translate("Product search results for")." <strong>".htmlentities($q,ENT_QUOTES,$config_charset)."</strong>&nbsp;";

...and REPLACE with:

switch($parts[0])
{
  case "merchant":case "category":case "brand":
    $banner["h1"] = $parts[1];
    break;
  default:
    $banner["h1"] = $parts[0];
    break;
}
$banner["h2"] = translate("Product search results")."&nbsp;";

Then in html/banner.php file look for the following HTML at line 1:

<div class='banner'>

...and REPLACE with:

<div class='banner'>
 <?php if (isset($banner["h1"])) : ?>
   <h1><?php print $banner["h1"]; ?></h1>
 <?php endif; ?>

You can then style the <h1> tag via .banner h1 in your CSS.

As it stands this will display the <h1> line containing either the merchant, category or brand name, or the query itself. If you don't want normal queries to be displayed in this way simply remove the following line from the mod:

    $banner["h1"] = $parts[0];

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by JasonG on Wed, 2012-11-21 12:37

Fantastic, thank you