Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

TITLE in index.php


SebiSeba

Recommended Posts

Posted

Hi all,

 

I would like to change the title "Categories" that appear in the index page when showing the categories. And I would like to put something like in the header to show the name of the current category (e.g. : category 1 >> subcategory 2... )

 

In the header, to show this (e.g. : Home>> Catalogue >> category 1), it's using a fonction that is contain by the file breadcrunmb.php. But actually I don't understand breadcrunmb.php !

 

From where come 'title' ?

From where come 'link' ?

 

If anybody could help me even a little, give me a little tip, it would be wonderfull !!

 

!! - HAPPY NEW YEAR :D

 

 

In header.php :

 

<?php echo $breadcrumb->trail(' » '); ?>

 

 

 

In breadcrumb.php :

 

class breadcrumb {

var $_trail;

 

function breadcrumb() {

$this->reset();

}

 

function reset() {

$this->_trail = array();

}

 

function add($title, $link = '') {

$this->_trail[] = array('title' => $title, 'link' => $link);

}

 

function trail($separator = ' - ') {

$trail_string = '';

 

for ($i=0, $n=sizeof($this->_trail); $i<$n; $i++) {

if (isset($this->_trail[$i]['link']) && tep_not_null($this->_trail[$i]['link'])) {

$trail_string .= '<a href="' . $this->_trail[$i]['link'] . '" class="headerNavigation">' . $this->_trail[$i]['title'] . '</a>';

} else {

$trail_string .= $this->_trail[$i]['title'];

}

 

if (($i+1) < $n) $trail_string .= $separator;

}

 

return $trail_string;

}

}

?>

Posted

I am not sure if I understand you correctly but osC is already doing this ?!

When you have setup and named your categories, subcategories etc. the navigation bar will show the name of the category and sub-category as you want when you select them. If you would like to change the name appearing into the header of the category box you only have to chance that within your catalog/includes/languages/english.php and/or all other language .php files.

 

Hope this helps and Happy New Year too !

Posted

Whenever you go to a new page in your shop, the title and link is added to breadcrumb trail in application_top.php

Posted
Whenever you go to a new page in your shop, the title and link is added to breadcrumb trail in application_top.php

 

wheeloftime, the thing is that I want to do something like in the header but in the 'title' of the page ! So, I have to understand what's doing in the header !

Thanks a lot !

I'll look further for it in application_top.php !!

Posted
wheeloftime, the thing is that I want to do something like in the header but in the 'title' of the page ! So, I have to understand what's doing in the header !

Thanks a lot !

I'll look further for it in application_top.php !!

 

 

It's working !

Thanks a lot !!! :thumbsup:

Posted
How did you do it?

 

I've just :

 

- created a new file named breadcrumb2.php in the same place of breadcrump.php (a copy of breadcrump.php)

- changed the name of the variable ( I added a "2" in the end of variable's name)

- copied/pasted the "breadcrump's functions" in application_top, changed the names needing to be changed and removed in application_top the things I didn't want to appear

- and in the index.php, made reference to breadcrump2.php just as it's done in the header to breadcrump.php

Posted
I've just :

 

- created a new file named breadcrumb2.php in the same place of breadcrump.php (a copy of breadcrump.php)

- changed the name of the variable ( I added a "2" in the end of variable's name)

- copied/pasted the "breadcrump's functions" in application_top, changed the names needing to be changed and removed in application_top the things I didn't want to appear

- and in the index.php, made reference to breadcrump2.php just as it's done in the header to breadcrump.php

 

 

no need to duplicate the class:

 

http://www.oscommerce.com/forums/index.php?showtopic=125724

Treasurer MFC

Archived

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

×
×
  • Create New...