Post by superuser » Mon Dec 28, 2009 11:47 am

Can I know what file o edit in order to get the breadcrumb display between left and right column(above the page content and not in the header file)?

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> 
Then I create a new breadcrumb.php in controller/common

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();
	}
}
?>
Finally I testing it in the product page by adding <?php echo $breadcrumbs; ?> somewhere in the product.tpl

However, it shows:
Notice: Undefined variable: breadcrumbs in /home/mysite/public_html/catalog/view/theme/default/template/product/product.tpl on line 8
May I know anything wrong with my code? Thank you!

New member

Posts

Joined
Sat Dec 19, 2009 8:15 pm

Post by vimal » Mon Dec 28, 2009 8:18 pm

In the css file. Check for

#breadcrumb {
padding: 0px 0px 5px 15px;
}

Change the value of red number to align it in the center.

www.beeshop.se
Starta webbshop, Starta e-butik, Starta e-handel


Active Member

Posts

Joined
Wed Aug 26, 2009 8:54 am
Location - Sweden

Post by superuser » Tue Dec 29, 2009 11:02 am

vimal wrote:In the css file. Check for

#breadcrumb {
padding: 0px 0px 5px 15px;
}

Change the value of red number to align it in the center.

Thanks for your suggestion vimal...

However, if i do it that way, the left and right column will appear below the breadcrumb.

Do you have any other idea?

New member

Posts

Joined
Sat Dec 19, 2009 8:15 pm

Post by vimal » Wed Dec 30, 2009 6:41 pm

I tried to change the home file and it works on the first page but not sure how to get it on all the pages. There are files form column left and right but none for center! hehe

Anyone could point to how to modify the column middle for all pages?

www.beeshop.se
Starta webbshop, Starta e-butik, Starta e-handel


Active Member

Posts

Joined
Wed Aug 26, 2009 8:54 am
Location - Sweden

Post by christopherdarling » Wed Jan 13, 2010 12:19 am

Code: Select all

<?php foreach (Controller::__get('document')->breadcrumbs as $breadcrumb) { ?>
    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
<?php } ?>
in your .tpl file will get the breadcrumbs

Christopher Darling - Web Design Bristol


New member

Posts

Joined
Sat Jan 02, 2010 12:26 am

Post by christopherdarling » Wed Jan 13, 2010 12:28 am

p.s. you will need to add that for each .tpl file that you want it to display on.. i.e.

templates/product/category.tpl
templates/product/product.tpl
etc..


Alternatively, you can make it appear inside the middle column by using CSS and floats. That will avoid having to edit each .tpl file

Christopher Darling - Web Design Bristol


New member

Posts

Joined
Sat Jan 02, 2010 12:26 am
Who is online

Users browsing this forum: No registered users and 19 guests