Does anyone have any ideas on how to make this possible?
Is this possible with opencart?
Any help is greatly appreciated.
PS - If possible, can this same functionality be applied to information pages as well?
Thanks
There is probably an SEO mod that does this now

The main goal was to add additional text to the existing title, such as 'Existing Title - Here's the additional text...' - in some sort of targeted fashion. And of course, this includes the category / product pages.
I decided to use the the 'meta tag keywords' field of both categories and products to drive the additional title text when available - and if that doesn't exist (as is the case with home / information / contact / etc.) then apply a default (for now).
Deadcow SEO module was a good way to auto-populate each product's 'meta tag keywords' field since it allows you to automatically pull in other variables, like category and model (in addition to it's main function which is automating your SEO URL text!) and then I manually entered info into each category's meta tag keywords field, and the default additional title text is simply a language variable in header.php. Future plan is to expand this default to define a unique additional title text for each individual "informational" page, but for now just getting an expanded title, especially on the home page, is better than the default IMO.
Since I document all of my changes, I already have the steps I followed so here they are w/some comments...
(1) I added the default 'additional title text'...
Code: Select all
$_['text_title'] = 'My default additional title text with keywords/phrases etc.';
Since for now this is the universal text for the 'keywordless' pages, I matched it somewhat to my categories, which contain my main key phrases and are available on each page - as well as my home text. Again, this can be targeted on a near per-page basis by simply performing these first 2 steps for each specific page language/controller file. Obviously, if you have other languages, this would be applied accordingly.
(2) I added...
Code: Select all
$this->data['text_title'] = $this->language->get('text_title');
This makes the variable in (1) available to the .tpl. Since I only use english, I'm not sure how dynamic multi-language is applied to seo (if at all??? I don't see how), but whatever the case if someone has multiple language files this facilitates it.
(3) Then I made a single CORE modification to catalog/view/theme/<whateveryourthemeis>/template/common/header.tpl where the <title> is defined:
Code: Select all
<title><?php echo $title; ?> - <?php if ($keywords) echo $keywords; else echo $text_title; ?></title>
Then I installed deadcow SEO module, and used it to populate the meta tag keyword entries for all my products (using the [Category Names], [Model Name] variables), and entered my category keywords manually (as I don't have too many), though this could likely be automated if you have a lot of categories. For me, if it was a parent Category, I used keywords relating to the sub categories, and if not a parent category, keywords relating to the products inside it. Was a pain to do this initially but now I just enter the info on the fly since I know what I need there.
So, the output looks like...
Home/Contact/Info pages:
"Page Title - Default additional title text with keyphrase, keyphrase and keyphrase with whatever"
Category pages:
"Category Name - Meta Tag Keyword text as entered in the category admin page""
Product pages:
"Product Name - Tiered Category names and model number as generated by deadcow SEO"
That's about it. I might try to apply this using something like vQmod to keep it all separate in the future but haven't had the time to check it out yet, so good change documentation is the key for now. Of course there might also be a cool SEO mod that does all of this now, but maybe something here will still be helpful in establishing a process that works best for you...

1.4.9.4
With thanks to mwaste for his post here:
http://forum.opencart.com/viewtopic.php?f=24&t=7685
Add a 'title' column to the database table 'category_description'
Code: Select all
ALTER TABLE `category_description` ADD `title` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL
Code: Select all
$_['entry_title'] = 'Category Title:';
Code: Select all
$this->data['entry_title'] = $this->language->get('entry_title');
to public function editCategory($category_id, $data)
and public function addCategory($data)
add this to the database query
Code: Select all
"', title = '" . $this->db->escape($value['title']) .
Code: Select all
'title' => $result['title'],
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>

In catalog/controller/product/category.php add:
Code: Select all
$this->document->meta_title = $category_info['title'];
Code: Select all
<title><?php
if ($meta_title != '') {
echo $meta_title;
} else {
echo $title;
}
?></title>
in catalog/controller/common/header.php find
Code: Select all
$this->data['title'] = $this->document->title;
Code: Select all
if (isset($this->document->meta_title)) {
$this->data['meta_title'] = $this->document->meta_title;
}
http://scarletandjones.com/
http://sharpdressedman.co.uk/
http://coffincompany.co.uk/
http://horsesculptures.co.uk/
If I've helped you out, why not buy me a beer? http://craigmurray.me.uk

Now if someone can combine the two, we might just have a frankenstein on our hands!
But on a serious note, the second option appears to be adding a field to the database and providing a direct category input for 'title' which then replaces the existing title, (and the same could work for information pages presumably following the same procedures), while I am trying to recycle the existing meta tag description fields and am using the language variables - which can also be extended to individual information pages - and ultimately leveraging the work of deadcow SEO for dynamic product titles. Also I am appending these to the existing titles, not replacing them.
I have no idea which is better, but I initially stumbled into my method after running deadcow SEO for SEO URL's and saw the ability to potentially take advantage of the deadcow SEO meta tag generator for products (which also has the option to pull valued keyword data from Yahoo based on product description), thus generating deeper product titles automatically. And I am still in hopes that a similar feature might be added to that mod for building category meta tags... meaning I could add / change products as well as categories, then I could simply run deadcow SEO and everything is updated automatically (not just the products). Gives the meta tag keyword field a little more purpose, but also means a 'keyword' structure is applied to the titles, maybe not where you want to go with it...
Given that you appear to be a professional in this field of SEO, and I am definitely a student of said field, I am curious what your thoughts are...
1.4.9.4
Product Name - Product Category - Product Brand
The reason being is that Google weights the first keyword of a title more than the 2nd, 3rd, 4th and so on. And you want your category pages to rank for the category keyword based on the fact that they are fewer clicks from the homepage, making them more important in the eyes of google.
Basically if you had a website that sold beverages and had the following pages:
Category Page: Sodas
Meta Title: Sodas
Product Page - Diet Coke
Meta Title: Sodas - Diet Coke
There is a chance that when some searches "soda" they could be brought to the product page for diet coke rather than the intended category pages. That is why it's better to have the follow:
Category Page: Sodas
Meta Title: Sodas
Product Page: Diet Coke
Meta Title: Diet Coke - Sodas (notice the switch in keyword placement)
It seems that many people overlook the power of well optimized category pages. For many of our clients, the STRONG MAJORITY of the search traffic is to category pages. Make sure you have enough page copy with the same keywords which are in the title are in your page copy. The more categories the better...as long as it makes sense for the user as well. Each category pages is a new potential landing page. Take advantage of this and use http://www.adwords.google.com/keywordtool to find the search quantity for your keywords.
I hope this helps, thanks again for your indepth responses. Any other SEO questions you have feel free to post and I will do my best to answer them.
b>Notice</b>: Undefined variable: meta_title in <b>/home1/beerpon1/public_html/catalog/view/theme/CartMania-Clean/template/common/header.tpl</b> on line <b>6</b>Best Beer Pong Tables for Sale
For the homepage title.
Is the Title being added and saved in your Admin section? That is, can you add a Title, save it, and when you go back to the Category page it is still there. If so the SQL worked and all the admin stages worked, which means you're almost there.
Let me know and we'll see if we can fix this.
http://scarletandjones.com/
http://sharpdressedman.co.uk/
http://coffincompany.co.uk/
http://horsesculptures.co.uk/
If I've helped you out, why not buy me a beer? http://craigmurray.me.uk
I looked in catalog/controller/common/header.php and couldnt find
$this->data['title'] = $this->document->title;
Does this not apply to my version?
Also, I am getting the following error when saving changes to a category:
Notice: Undefined variable: value in /home1/beerpon1/public_html/admin/model/catalog/category.php on line 30Error: Unknown column 'title' in 'field list'
Error No: 1054
UPDATE category SET parent_id = '0', sort_order = '4', status = '1', title = '', date_modified = NOW() WHERE category_id = '40'
I went into myphpadmin and the field title is there. (see attached screenshot)
Let me know if there is any other info I could provide to help troubleshoot the problem.
Thanks again!
Attachments
screenshot of database - database.jpg (176.82 KiB) Viewed 168783 times
IN:
Code: Select all
/catalog/view/theme/YOURTHEME/template/common/header.tpl
Code: Select all
<?php echo $title; ?>
Code: Select all
<?php echo $keywords ? $keywords : $title; ?>
If you're using 1.4.9.4 you don't need to worry about the last bit.
Looks like I wasn't clear enough, so apologies - it looks like you are trying to update the 'category' table with the title, but the title is in the category_description table. This line
Code: Select all
"', title = '" . $this->db->escape($value['title']) .
Code: Select all
foreach ($data['category_description']
Craig
http://scarletandjones.com/
http://sharpdressedman.co.uk/
http://coffincompany.co.uk/
http://horsesculptures.co.uk/
If I've helped you out, why not buy me a beer? http://craigmurray.me.uk
http://forum.opencart.com/viewtopic.php?f=131&t=27774
I heart cmd-f, cmd-c, cmd-v, cmd-z + vQmod.
My favourite page...
v1.5.4.1
OC version is 1.4.9.3
Category pages works out fine accordingly with each category page displaying the Title Entry. However, for the following pages i get the same error:
- Homepage
- index.php?route=product/products
- index.php?route=information/applynow
Error:
<title><b>Notice</b>: Undefined variable: meta_title in <b>server URL/header.tpl</b> on line <b>9</b>Example</title>
I'm guessing that the code wasn't able to find the meta_title variable (since the pages aren't associated with the product category table) and starts to output an error text together with $title, which should not be happening as
if $meta_title = ' ' , it should just display $title by default and nothing else.
anyone has any ideas?
Also, i'm curious as to where can i locate the appropriate files to edit if i wanted to edit the above mentioned pages for meta keywords, description and titles.
Cheers Mick
Code: Select all
<title><?php echo $title; ?></title>
Code: Select all
<title><?php
if (isset($meta_title)) {
if ($meta_title != '') {
echo $meta_title;
} else {
echo $title;
}
} else {
echo $title;
}
?></title>
http://scarletandjones.com/
http://sharpdressedman.co.uk/
http://coffincompany.co.uk/
http://horsesculptures.co.uk/
If I've helped you out, why not buy me a beer? http://craigmurray.me.uk
The empty function allows you to do both of those checks at once, so you could reduce the code to:Chones wrote:Apologies - here's is how to fix the undefined variable. In the header.tpl file find
and replace withCode: Select all
<title><?php echo $title; ?></title>
Code: Select all
<title><?php if (isset($meta_title)) { if ($meta_title != '') { echo $meta_title; } else { echo $title; } } else { echo $title; } ?></title>
Code: Select all
<title><?php echo (empty($meta_title)) ? $title : $meta_title; ?></title>
http://scarletandjones.com/
http://sharpdressedman.co.uk/
http://coffincompany.co.uk/
http://horsesculptures.co.uk/
If I've helped you out, why not buy me a beer? http://craigmurray.me.uk
I'm running 1.5 and did the "category" title add as specified by Chones. Everything is showing up the database and all, but it does not return the proper title and still only displays the category name as the title.
Any clues?
jonlauren.com
erichedvat@gmail.com
732-539-8011
when i change this row in
controller/product/category.php
$this->document->setTitle($category_info['title']);
now i get custom title
I have just written a blog post on creating custom titles within OpenCart Category and Product pages. No need to amend the database but just use exiting variables!
http://www.jackwdavis.com/2012/02/17/cr ... ory-pages/
Let me know how it works out for you!
Cheers,
Jack
Destrove is a professional Web Development, SEO, Marketing and eCommerce company based in Lincoln, UK that specialises in OpenCart Development.
http://www.destrove.com
We now offer a specialised OpenCart Web Hosting Service at great rates, hosting clients get discounted OpenCart Development! http://www.destrove.com/services/opencart-web-hosting
Users browsing this forum: No registered users and 27 guests