Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Custom Header in categories pages


jgarite

Recommended Posts

I need to make custom headers for individual category pages. Can anyone tell me how to do this? I'm not talking about the coding, I mean where it would say "Let's See What We Have Here..." , I need it to say

"Title" <br>

"Description"

 

Products listings

 

 

thanks in advance

Link to comment
Share on other sites

You'll find it in /includes/languages/english/index.php - look for the three instances of:

 

  define('HEADING_TITLE'

 

The first shows when you are viewing products, the second the front page and the third when you are viewing 'nested' sub categories :)

 

You can change each to display what you want

 

Sonia

Link to comment
Share on other sites

You'll find it in /includes/languages/english/index.php - look for the three instances of:

 

  define('HEADING_TITLE'

 

The first shows when you are viewing products, the second the front page and the third when you are viewing 'nested' sub categories :)

 

You can change each to display what you want

 

Sonia

Thanks, But I have 4 sub-categories in one category, and I need them each to have a different header. How do I do that?

 

here is the coidng:

<?php
/*
 $Id: index.php,v 1.1 2003/06/11 17:38:00 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 [url=http://www.oscommerce.com]http://www.oscommerce.com[/url]

 Copyright ? 2003 osCommerce

 Released under the GNU General Public License
*/

define('TEXT_MAIN', 'content is in here for the homepage');
define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s');
define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products');
define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');

if ( ($category_depth == 'products') || (isset($HTTP_GET_VARS['manufacturers_id'])) ) {
[color=#FF0000]  define('HEADING_TITLE', 'Let\'s See What We Have Here...');[/color]
 define('TABLE_HEADING_IMAGE', '');
 define('TABLE_HEADING_MODEL', 'Model');
 define('TABLE_HEADING_PRODUCTS', 'Product Name');
 define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
 define('TABLE_HEADING_QUANTITY', 'Quantity');
 define('TABLE_HEADING_PRICE', 'Price');
 define('TABLE_HEADING_WEIGHT', 'Weight');
 define('TABLE_HEADING_BUY_NOW', '');
 define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.');
 define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');
 define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');
 define('TEXT_SHOW', '<b>Show:</b>');
 define('TEXT_BUY', 'Buy 1 \'');
 define('TEXT_NOW', '\' now');
 define('TEXT_ALL_CATEGORIES', 'All Categories');
 define('TEXT_ALL_MANUFACTURERS', 'All Manufacturers');
} elseif ($category_depth == 'top') {
 define('HEADING_TITLE', '<img src=http://www.puppyhugger.com/catalog/images/featured_products.gif>');
} elseif ($category_depth == 'nested') {
define('HEADING_TITLE', 'Categories');
}
?>

 

By changing the line in red, wont it change that line for all the categories?? i need them to be specific to each page....

Link to comment
Share on other sites

I am new to OSCommerce but I think you will be able to print the category name if you use a little bit of code. I presume the category title will already be specified you will just need to find out what it is and then print it <?php print $categoryvariablenamehere; ?> and that should print an individual name for each page.

 

Sorry I cant be of more use but I hope it points you in the right direction. I have only just started working on OS but if I find out I will post it.

Link to comment
Share on other sites

I would make take a solution like:

 

if ($_HTTP_GET_VARS['cPath'] == 'YOUR CATEGORY FOR DIFFERENT HEADER') {
echo DIFFERENTHEADER1;
} elseif ($_HTTP_GET_VARS['cPath'] == 'YOUR secondCATEGORY FOR DIFFERENT HEADER') {
echo DIFFERENTHEADER2;
} elseif ($_HTTP_GET_VARS['cPath'] == 'YOUR thirdCATEGORY FOR DIFFERENT HEADER') {
echo DIFFERENTHEADER3;
} elseif ($_HTTP_GET_VARS['cPath'] == 'YOUR fourthCATEGORY FOR DIFFERENT HEADER') {
echo DIFFERENTHEADER4;
} else {
echo DEFAULTHEADER;
}

Than you would need to define the DIFFERENTHEADER1 and so forth.

Link to comment
Share on other sites

this is from a contribution

This is a simple method of displaying Catagory name in the Page Title, instead of

the standard "Let's See What We Have Here" message.

 

Last Edited 2nd December 2005 21:14 CMT by rued

 

Added this function for sub folders (Categories) too,

e.g. if you now go to the Hardware Categorie and this contains sub categories

- it wil show "Hardware Categories" as Page Title

 

 

##################################

1st Alteration:

 

includes/classes/breadcrumb.php

 

Original:

 

class breadcrumb {

var $_trail;

 

 

function breadcrumb() {

$this->reset();

}

 

 

 

Change to:

 

class breadcrumb {

var $_trail;

 

function last() {

$trail_size = sizeof($this->_trail);

return $this->_trail[$trail_size-1]['title'] ;

}

 

function breadcrumb() {

$this->reset();

}

 

 

##################################

2nd (& 3rd) Alteration:

 

Directory: includes/languages/english/index.php

 

Around Line 19:

 

define('HEADING_TITLE', 'Let\'s See What We Have Here');

 

Alter to:

 

define('HEADING_TITLE', $breadcrumb->last());

 

 

Around Line 39:

 

define('HEADING_TITLE', 'Categories');

 

Alter to:

 

define('HEADING_TITLE', $breadcrumb->last() . ' ' . 'Categories');

 

 

 

Save both files and you will not get the catagory heading at the top of each catagory page

instead of the standard "Let's See What We Have Here" and "Categories"

My Contributions

 

Stylesheet With Descriptions Glassy Grey Boxtops Our Products Meta Tags On The Fly

Password Protect Admin

"No matter where you go....There you are" - Buccaroo Bonsai

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...