Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Breadcrum in title


boxtel

Recommended Posts

Posted

open breadcrumb.php class

 

add this function :

 

 

function trail_simple($separator = ' - ') {

$trail_string = '';

 

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

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

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

}

return $trail_string;

}

 

 

in product_info.php

 

<?php echo '<title>' . TITLE . ' :: ' . $breadcrumb->trail_simple(' » ') . '</title>';?>

Treasurer MFC

Posted

not sure if posting here is ok . i want to have only date displayed in bredcrumb .. without categories displayed when in some category

 

tenx

  • 3 weeks later...
Posted

Why not just use:

<title><?php echo TITLE . ' :: ' . strip_tags($breadcrumb->trail(' » ')); ?></title>

This will save them from editing the class and will have exactly the same output.

 

Bobby

Posted
Why not just use:

<title><?php echo TITLE . ' :: ' . strip_tags($breadcrumb->trail(' » ')); ?></title>

This will save them from editing the class and will have exactly the same output.

 

Bobby

 

because I did not want the "home" or "top" to show up in the title.

Therefore, I start the for loop from record 1 instead of record 0 of the array

Treasurer MFC

Posted

aahhh...I see the light. Very nice!

 

Bobby

Posted

Ok, to be fair, I don't know that it started happening after installing page cache, it's just that it started around the same time. I didn't notice when it started, only after a while.

 

I therefore have no idea what I did to cause this. All I get for the page title is my store name :: . Same problem with "really easy html title", so I know that it's got to be something with accessing that breadcrumb at that point in the code.

 

-jared

Posted

found it. When we move the code that builds the breadcrumb from application_top.php to header.php, it's not available in index.php until header.php loads (which is after we need the title).

 

Bobby, I see that you have this working on mesoimpact.com - - care to elaborate?

 

I think that I may know a way to get it to work, but I'm curious what you did.

 

-jared

Posted

If I move the breadcrumb construction back into application_top.php, it works, but then I get a dual breadcrumb (though not in the title).

 

Home >> Home >> Category1 >> Category1 >> Product11 >> Product11

 

I suppose we could have two instances of the breadcrumb, one for the page title (built in application_top.php) and one for the cached page (built in header.php).

 

Somehow, that just seems like *way* too much of a kluge.

 

-jared

Posted
If I move the breadcrumb construction back into application_top.php, it works, but then I get a dual breadcrumb (though not in the title).

 

Home >> Home >> Category1 >> Category1 >> Product11 >> Product11

 

I suppose we could have two instances of the breadcrumb, one for the page title (built in application_top.php) and one for the cached page (built in header.php).

 

Somehow, that just seems like *way* too much of a kluge.

 

-jared

 

 

if you install the latest version of page cache you do not have that problem, no need to move anything to the header, 1 breadcrumb. try it.

Treasurer MFC

Posted

will do. don't remember which version I installed. I'll go check and give it a shot.

 

-jared

Posted

I wish the osC project had some mechanism to contact the store owners that installed a contribution. For instance, the vBulletin.org site has an option to click "installed" after you download (or even before) and you can be contacted on updates.

 

This would help the contribution coders to stay in touch with the ones that have installed a particular version and not have them wade through X number of pages to get to the revised package announcement.

 

Jared => I uploaded a final page cache release that takes care of the breadcrumb. For those that have not installed it the directions are much more clear and less file editing to do. To upgrade move the breadcrumb info back to application_top.php (restore that part) and remove the page cache code on index.php and product_info.php. Then follow the code additions in the install directions (there were no changes to the class). If you need help just contact me and I'll walk you through it. The latest release should correct the problems you've been having with the other breadcrumbs too.

 

Bobby

Archived

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

×
×
  • Create New...