I tried to cut and paste the breadcrumb script from the header.tpl to a new breadcrumb.tpl file.
Code: Select all
<div id="breadcrumb">
<?php foreach ($breadcrumbs as $breadcrumb) { ?>
<?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
<?php } ?>
</div>
Code: Select all
<?php
class ControllerCommonBreadcrumb extends Controller {
protected function index() {
$this->language->load('common/header');
$this->data['breadcrumbs'] = $this->document->breadcrumbs;
$this->id = 'breadcrumb';
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/breadcrumb.tpl')) {
$this->template = $this->config->get('config_template') . '/template/common/breadcrumb.tpl';
} else {
$this->template = 'default/template/common/breadcrumb.tpl';
}
$this->render();
}
}
?>
However, it shows:
May I know anything wrong with my code? Thank you!Notice: Undefined variable: breadcrumbs in /home/mysite/public_html/catalog/view/theme/default/template/product/product.tpl on line 8