Post by johny2k » Tue Aug 19, 2008 10:25 am

hi, hope some one can help me, below is the attachment files, i would like to add a company name as Top Lamp at before title word. Thank you. :D :D

Regards,
John

Attachments

???
title2.jpg
???
title.jpg
Last edited by johny2k on Wed Aug 20, 2008 12:53 pm, edited 1 time in total.

New member

Posts

Joined
Tue Mar 04, 2008 4:35 pm

Post by Qphoria » Tue Aug 19, 2008 10:43 am

There doesn't appear to be a good way at this point. But there is a way:

Edit your library/template/template.php file and change this:

Code: Select all

function set($key, $value = NULL) {
    	if (!is_array($key)) {
      		$this->data[$key] = $value;
    	} else {
	  		$this->data = array_merge($this->data, $key);
		}
  	}
to this:

Code: Select all

function set($key, $value = NULL) {
    if (!is_array($key)) {
        if ($key == "heading_title") {
            $this->data[$key] = "My Store - " . $value;
        } else { 
            $this->data[$key] = $value;
        }
    } else {
        $this->data = array_merge($this->data, $key);
    }
}
Change "My Store" to your store name

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by johny2k » Tue Aug 19, 2008 10:45 am

Thank You So Much, I will try it,  :D

New member

Posts

Joined
Tue Mar 04, 2008 4:35 pm

Post by johny2k » Tue Aug 19, 2008 11:12 am

Qphoria wrote: There doesn't appear to be a good way at this point. But there is a way:

Edit your library/template/template.php file and change this:

Code: Select all

function set($key, $value = NULL) {
    	if (!is_array($key)) {
      		$this->data[$key] = $value;
    	} else {
	  		$this->data = array_merge($this->data, $key);
		}
  	}
to this:

Code: Select all

function set($key, $value = NULL) {
    if (!is_array($key)) {
        if ($key == "heading_title") {
            $this->data[$key] = "My Store - " . $value;
        } else { 
            $this->data[$key] = $value;
        }
    } else {
        $this->data = array_merge($this->data, $key);
    }
}
Change "My Store" to your store name


Hi, i just try your way, but still no have any effect........ sorry for disturb you again....  :'(

New member

Posts

Joined
Tue Mar 04, 2008 4:35 pm

Post by Qphoria » Tue Aug 19, 2008 11:36 am

Ah yea, seems there are also ties into the language file too... I'll see what i can do

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by johny2k » Tue Aug 19, 2008 12:14 pm

Qphoria wrote: Ah yea, seems there are also ties into the language file too... I'll see what i can do
Dear Qphoria Brother,

I think maybe i got miss something to tell you. Please view the attachment below. I just want to add top lamp word at page title, sorry for confuse you.... :-X

Attachments

???
request.jpg

New member

Posts

Joined
Tue Mar 04, 2008 4:35 pm

Post by bruce » Tue Aug 19, 2008 4:43 pm

the following statement in each controller sets the title on the browser

Code: Select all

		$template->set('title', $language->get('heading_title'));
If the language file values do not suit your purpose, you could set the second parameter using a program variable as follows

Code: Select all

		$my_title = 'Top Lamp'; // shown as a constant, but could get a value from wherever you like
		$template->set('title', $my_title);

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by Qphoria » Tue Aug 19, 2008 7:19 pm

johny2k wrote:
Qphoria wrote: Ah yea, seems there are also ties into the language file too... I'll see what i can do
Dear Qphoria Brother,

I think maybe i got miss something to tell you. Please view the attachment below. I just want to add top lamp word at page title, sorry for confuse you.... :-X
LOL! Whoops wrong title then. I think bruce got it working right for you.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by johny2k » Wed Aug 20, 2008 10:26 am

bruce wrote: the following statement in each controller sets the title on the browser

Code: Select all

		$template->set('title', $language->get('heading_title'));
If the language file values do not suit your purpose, you could set the second parameter using a program variable as follows

Code: Select all

		$my_title = 'Top Lamp'; // shown as a constant, but could get a value from wherever you like
		$template->set('title', $my_title);
Dear Bruce,

Can you show me which php files i should modify? is it from catalog/controller??? Sorry for stupid question.....  :-X

New member

Posts

Joined
Tue Mar 04, 2008 4:35 pm

Post by bruce » Wed Aug 20, 2008 10:35 am

probably all in catalog\controller

but certainly...

catalog\controller\category.php
catalog\controller\product.php

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by johny2k » Wed Aug 20, 2008 11:04 am

bruce wrote: probably all in catalog\controller

but certainly...

catalog\controller\category.php
catalog\controller\product.php
Thanks Bruce, but in catalog/controller/category.php & product.php, i only saw $template->set('title', $category_info['name']); , i try to replace the code you provide - $template->set('title', $language->get('heading_title')); , but it`s nothing happen, it just show as heading_title word.......

& where should i add this code?  ::):

$my_title = 'Top Lamp'; // shown as a constant, but could get a value from wherever you like
$template->set('title', $my_title);

Regards,
John

New member

Posts

Joined
Tue Mar 04, 2008 4:35 pm

Post by Qphoria » Wed Aug 20, 2008 11:18 am

Get a good editor that does "Replace in files". UltraEdit does it, there are likely a few others.
Do a search for all the spots that make a call to
$template->set('title', $language->get('heading_title'));
and change to
$template->set('title', "Top Lamp - " . $language->get('heading_title'));

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by johny2k » Wed Aug 20, 2008 12:52 pm

Qphoria wrote: Get a good editor that does "Replace in files". UltraEdit does it, there are likely a few others.
Do a search for all the spots that make a call to
$template->set('title', $language->get('heading_title'));
and change to
$template->set('title', "Top Lamp - " . $language->get('heading_title'));
Thanks Qphoria & Bruce, i have been solve the problem thank you so much!!!!  :-* :-*

Regards,
John

New member

Posts

Joined
Tue Mar 04, 2008 4:35 pm
Who is online

Users browsing this forum: No registered users and 4 guests