Page 1 of 1

[SOLVED]Error when trying to insert contactus link in header

Posted: Sat Nov 05, 2011 6:08 pm
by thbor83
Hi,

We want to move the contact us link up in the header.tpl file.
I have pasted in this line <a href="<?php echo $contact; ?>"><?php echo $text_contact; ?></a> in catalog/view/theme/default/template/common/header.tpl

And in the language file header.php i found under /catalog/language/english/common/ I have inserted this line
$_['text_contact'] = 'Contact';

When i refresh the site (I have deleted all cache) i get this error message:
Notice: Undefined variable: text_contact in /catalog/view/theme/default/template/common/header.tpl on line 104

Does anybody know how I can fix this, tried to search on the forum but didn't find any solution yet.

Regards
Thomas

Re: Error when trying to insert contact us link in header

Posted: Sat Nov 05, 2011 7:09 pm
by SXGuy
didnt try searching very hard lol been mentioned 2 days ago.

catalog/controller/common/header.php

find

Code: Select all

protected function index() {
insert after

Code: Select all

$this->language->load('module/information');
	
	$this->data['text_contact'] = $this->language->get('text_contact');
$this->load->model('catalog/information');

$this->data['contact'] = $this->url->link('information/contact');
thats the correct way to do it.

Re: Error when trying to insert contact us link in header

Posted: Sat Nov 05, 2011 7:39 pm
by thbor83
thought I was a good boy and searched the forum but no this I wasn't good enough. :(
Thanks for your reply SXGuy, now it's working fine.