Re: Site name in Title
Posted: Wed Apr 03, 2013 4:50 am
Can someone put here same code to adding in title a breadcrumbs for v1.5.4.1
Please!
Please!
OpenCart Community Forum - Discuss shopping cart and e-commerce solutions.
https://forum.opencart.com/
Code: Select all
if($this->document->getTitle()!='')
{
$data['title'] = $this->config->get('config_name') . ' :: ' .$this->document->getTitle();
}else{
$data['title'] = $this->config->get('config_meta_title') ;
}
Code: Select all
$this->document->setTitle('');
Hi guys! This code is not working on Opencart 2.2.0.0matteo84 wrote:Hi Paola!paola84 wrote:How can I make this modification in v1.4.7 ?
I'm new to OpenCart... so i don't know if this is the best way to solve the problem.
In /catalog/controller/view/theme/default/template/common/header.tpl approximately at line #5 you'll findReplace this line with this code...Code: Select all
<title><?php echo $title; ?></title>
This should solve your problem.Code: Select all
<title> <?php # BEGIN - titleBreadCrumbs if(!empty($this->document->breadcrumbs)) { $titleBreadCrumbs = array(); foreach($this->document->breadcrumbs as $breadcrumb) { if($breadcrumb['text'] != $this->language->get('text_home')) $titleBreadCrumbs[] = $breadcrumb['text']; } $titleBreadCrumbs = array_reverse($titleBreadCrumbs); echo implode(' - ', $titleBreadCrumbs) . ' - '; } echo $this->config->get('config_title'); # END - titleBreadCrumbs ?> </title>
Regards.
Matteo
Code: Select all
$this->config->get('config_name')
Code: Select all
$name
Nice1, finally got it to work with this, how would i change it so domain comes after category and product info, Thanks.mogwaycz wrote: ↑Thu Jan 26, 2012 11:09 amFor OC 1.5.1.3:
in catalog/controller/product/product.php find:and replace:Code: Select all
$this->document->setTitle($product_info['name']);
in catalog/controller/product/category.php find:Code: Select all
if (isset($product_info['manufacturer'])) { $this->document->setTitle('YOURDOMAIN.XYZ - '. $product_info['name'] . ' od ' . $product_info['manufacturer']); } else { $this->document->setTitle('YOURDOMAIN.XYZ - '. $product_info['name']); }
and replace:Code: Select all
$this->document->setTitle($category_info['name']);
That's all...Code: Select all
$this->document->setTitle('YOURDOMAIN.XYZ - ' . $category_info['name']);