Post by Meto » Tue Apr 10, 2012 7:18 pm

Try to do step by stop but fail :). Got title column on SQL, but when i write title from admin panel its just dont save it to DB. Also i try to add titles from phpadmin, well its work, but when i do some change from shop admin panel on category`s. Title gone... i guess i fail on model/catalog/category.php. Any idea where i do wrong? Or if its not problem someone upload fixed category.php ? Thanks

Newbie

Posts

Joined
Tue Apr 10, 2012 7:14 pm

Post by xl5 » Wed Apr 11, 2012 5:00 pm

Hi
Can someone tell me how i can add custom titles for manufacturer pages?
Thanks
ps i have a mod for manufacturer description added, my site is:
http://www.gallerysales.co.uk/
Last edited by xl5 on Thu Apr 12, 2012 3:50 am, edited 1 time in total.

xl5
New member

Posts

Joined
Mon Jul 18, 2011 3:45 pm


Post by xl5 » Wed Apr 11, 2012 5:05 pm

Preferably using the meta tag description if not seo keyword would do fine
Cheers

xl5
New member

Posts

Joined
Mon Jul 18, 2011 3:45 pm


Post by toolsandtimber » Wed Jun 20, 2012 3:50 pm

Hey guys, slight problem with getting this working....

It only shows up on the title of the page when I change a line in the controller.php file at controller/product/category.php
$this->document->setTitle($category_info['name]);

changes to

$this->document->setTitle($category_info['title]);

only thing is when there is no custom title present then the title dissapears!

Can anyone help please. I am using 1.5.1.3 here is a sample of my current controller file

if ($category_info) {
$this->document->setTitle($category_info['name']);
$this->document->setDescription($category_info['meta_description']);
$this->document->setKeywords($category_info['meta_keyword']);

Thanks,

TTguy O0

New member

Posts

Joined
Wed Nov 23, 2011 5:47 pm

Post by sportyhabits » Fri Jul 13, 2012 12:55 pm

There are two way of adding individual title on every page be it category or product page.
1) Create a separate database table and read it at time of rendering
2) Use of one of existing table like meta-keyword and use it for both title and meta-keyword

I prefer the option #2 because with first one extra table needs to b added in mysql and it might break some of other module or upload methods.

So the way I implemented is add title information also keyword table and tagged it ex. [title] newTitle [/title] and parse it in header.tpl before rendering the page. This way I have achieved separate title information for each and every page. I also added code that if title information is not available per page the put default value from $title. If you need code or more information you can send me email at sportyhabits@gmail.com

Newbie

Posts

Joined
Sat Jun 09, 2012 3:21 pm

Post by sinbad » Thu Jul 19, 2012 12:48 pm

I'm also getting undefined meta_title on 1.5.3 install
The sql works and I can store my custom title.
anyone knows what's the updated code for the controller should be?

this breaks the page all together
$this->document->meta_title = $information_info['longtitle'];

User avatar
New member

Posts

Joined
Sun Oct 23, 2011 12:52 pm

Post by lelecarabina » Sun Jul 22, 2012 1:03 am

Hi!

I've been trying this all day. Finally got it to stop showing error messages in admin and in store front. Everything seems to be working perfectly, except that the changes I make to the newly created TITLE field, in the category edition page, do not hold and do not show on the Browser Page Title, in the store front. I save and when I come back to the edition page for the category, the title field is empty.

I am using OpenCart 1.5.0. and I configured the files as follows:

admin\model\catalog\category.php in line 145:

Code: Select all

'title'            => $result['meta_title'],
admin\controller\catalog\category.php in line 156:

Code: Select all

$this->data['entry_title'] = $this->language->get('entry_title');
admin\language\english\catalog\category.php, in line 17 (under // Entry)

Code: Select all

$_['entry_title'] 			 = 'Category Title:';
admin\view\template\catalog\category_form.tpl in line 37:

Code: Select all

<tr>
  <td><?php echo $entry_title; ?></td>
  <td><input name="category_description[<?php echo $language['language_id']; ?>][title]" size="100" value="<?php echo isset($category_description[$language['language_id']]) ? $category_description[$language['language_id']]['title'] : ''; ?>" /></td>
</tr>
catalog\controller\product\category.php in line 75:

Code: Select all

$this->document->setTitle($category_info['meta_title']);
catalog\view\theme\default\template\common\header.tpl in line 5 (inside header tags):

Code: Select all

<title><?php 
if (isset($meta_title)) {
if ($meta_title != '') {
    echo $meta_title;
  } else {
    echo $title;
  } 
} else {
    echo $title;
} 
?></title>
Can anyone help?

Thanks :)

User avatar
Newbie

Posts

Joined
Tue Jul 05, 2011 10:40 pm
Location - Florida, USA
Who is online

Users browsing this forum: No registered users and 17 guests