Post by exentric » Tue Jan 31, 2012 5:54 pm

I had to come up with a quick fix for the seo title in the category pages and didn't want to pay for an addon for this.
also had no time to add another variable and play with the database etc.
Here is the quick fix so you can have a better title for the category pages instead of the category name
open controller/common/header.php
find

Code: Select all

$this->data['categories'][] = array(
'name'     => $category['name'],
and replace with

Code: Select all

					
$title_array = explode(' ', $category['name']);
$first_word = $title_array[0];
$this->data['categories'][] = array(
'name'     => $first_word,
What this does is that it grabs the first word in the category title to display in the menu,
so you can have a really long description in the category title which will be displayed in the browser for that category helping the SEO,
but will only display the first word of the title in your menu as to not mess it up

hope someone else finds this interesting

I work at web design
My opencart websites electromed.gr, tentes-nousas, μπομπονιερες, kloounoupoli


User avatar
Newbie

Posts

Joined
Tue Jan 31, 2012 5:38 pm
Location - Athens, Greece

Post by leedodson » Sun Feb 26, 2012 7:14 pm

Very interesting, exactly what I have been trying to do (without success lol)
Many thanks :)

Newbie

Posts

Joined
Fri Feb 24, 2012 5:48 am

Post by leedodson » Sun Feb 26, 2012 7:40 pm

Trouble is the menu structure below my main menu list, AND the Category list on the left column, still show the whole title...
More to do :(

Newbie

Posts

Joined
Fri Feb 24, 2012 5:48 am
Who is online

Users browsing this forum: No registered users and 1 guest