Page 1 of 1

How to add breadcrumbs to home page?

Posted: Mon Feb 24, 2014 5:11 pm
by riwakawebsitedesigns
Hi I would like to know what I need to do to be able to add breadcrumbs to the controller of the home controller.

Re: How to add breadcrumbs to home page?

Posted: Fri Feb 28, 2014 10:26 pm
by ocaddons
Hi,

It's easy to achieve as follows:

Step 1. Go to catalog > controller > common > home.php.

-- Find the following line:

Code: Select all

$this->data['heading_title'] = $this->config->get('config_title');
-- Add following code snippet after the line:

Code: Select all

$this->data['breadcrumbs'] = array();
		
		$this->data['breadcrumbs'][] = array(
				'text'      => $this->language->get('text_home'),
				'href'      => $this->url->link('common/home'),
				'separator' => false
		);

Step 2. Go to catalog/view/theme/default/template/common/home.tpl.

-- Find following line:

<div id="content"><?php echo $content_top; ?>

-- Add following code snippet after it:

Code: Select all

 <div class="breadcrumb">
    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
    <?php } ?>
  </div>
Please try it. If you need my assistance, please contact me via ocaddons@gmail.com. I could solve any issue in ecommerce store.