Post by Andaho » Tue Mar 18, 2014 4:34 am

I discovered this little gem of an extension (free): Automatic SEO Title (VQMOD)

But the only thing it doesn't let me do, is change the title of the homepage. What is the cleanest way to change the homepage title to not effect any other pages?

I want to change my homepage title for the google page listing to include a short description of who I am... But I only want this change for the homepage - all other pages should just display the store name (and the additions that Automatic SEO Title adds)

UPDATE: I should also add that I've tried searching for 30+ mins to find a solution, but all threads I find are covering how to add custom titles for categories/products - which Automatic SEO Title does perfectly anyway. - It's just the homepage I want to change :(
Last edited by Andaho on Tue Mar 18, 2014 8:09 am, edited 2 times in total.

New member

Posts

Joined
Wed Jul 10, 2013 4:15 am

Post by jgsw » Tue Mar 18, 2014 5:17 am

hi Andaho,

Re-read the question... edited answer...

Open the file: catalog/controller/common/home.php

Replace

Code: Select all

$this->document->setTitle($this->config->get('config_title'));
with

Code: Select all

$custom_title = 'Custom text here ' . $this->config->get('config_title') . 'Custom text here';

$this->document->setTitle($custom_title);
(backup and/or use vqmod)

this will work for single language opencart installs.

jgsw

Quick Edit Admin Panel (40% off!) - CSS Unique (only $10!)
Sticky Admin Menu (Free) - Add Scripts & Styles to head (Free)


Active Member

Posts

Joined
Sat Mar 16, 2013 3:13 am

Post by Andaho » Tue Mar 18, 2014 5:56 am

Awesome! thanks very much (haven't tested yet, writing the VQmod as soon as I've written this post).

I'm not very good with programming, and I don't understand why it has 'Custom text here' twice? - But I'll give it a go!...

What would be really cool is if someone could edit that free extension (in the OP) to add an admin-side editable text entry box... then I think that extension would be worthy of a permanent opencart integration :)

New member

Posts

Joined
Wed Jul 10, 2013 4:15 am

Post by Andaho » Tue Mar 18, 2014 6:19 am

hmmm, it didn't work, and I've got an error in the VQmod logs:

Code: Select all

---------- Date: 2014-03-17 22:15:27 ~ IP : 82.46.***.** ----------
REQUEST URI : /
VQMod::_parseMods - DOM UNABLE TO LOAD: **removed my url**/public_html/vqmod/xml/andaho_change_homepage_title.xml
----------------------------------------------------------------------
Attached is the XML file, why is it not working?

Attachments


New member

Posts

Joined
Wed Jul 10, 2013 4:15 am

Post by jgsw » Tue Mar 18, 2014 7:41 am

hey, well played with choosing the vqmod route... it looks like it should work if you remove the line breaks from the search term.

Once you have it working you'll see what the custom text parts means. The first custom text will go before your 'Original store title' and the second one will go after it. You may want to leave one of them empty.

jgsw

Quick Edit Admin Panel (40% off!) - CSS Unique (only $10!)
Sticky Admin Menu (Free) - Add Scripts & Styles to head (Free)


Active Member

Posts

Joined
Sat Mar 16, 2013 3:13 am

Post by stokeyblokey » Tue Mar 18, 2014 7:51 am

The problem is the forum link you put in the author section - use CDATA tags to make it work, like attached.

By the way I have no idea why the custom text is in twice, it wraps your store name so you get "custom text 1store namecustom text 2 unless you add padding spaces to your custom text, but you can easily change it I guess.
EDIT: It does work a treat mind ;D

Stokey

Stokey


User avatar
Active Member

Posts

Joined
Sat Aug 31, 2013 10:19 pm

Post by Andaho » Tue Mar 18, 2014 8:08 am

Ahhh awesome!... of course!!!! It was because of use of ? and & symbols in the link! - I used goo.gl to url shorten it instead... because I couldn't find this anywhere on the forum, I'm going to upload the final XML here and also create a new thread for it in Free Contributions - giving credit to you both for the help :)

Attachments


New member

Posts

Joined
Wed Jul 10, 2013 4:15 am

Post by jgsw » Tue Mar 18, 2014 6:47 pm

Well spotted stokey, I didn't clock the url causing the error.

and nicely done Andaho, free contributions like your vqmod are really useful timesavers :D

Quick Edit Admin Panel (40% off!) - CSS Unique (only $10!)
Sticky Admin Menu (Free) - Add Scripts & Styles to head (Free)


Active Member

Posts

Joined
Sat Mar 16, 2013 3:13 am

Post by stokeyblokey » Tue Mar 18, 2014 9:31 pm

Nice one Andaho and jgsw for another free mod for the community :)

I only spotted the URL because when I first started writing vQmods myself I kept messing them up and so got used to some of the many things that would make them fail lol

Stokey


User avatar
Active Member

Posts

Joined
Sat Aug 31, 2013 10:19 pm
Who is online

Users browsing this forum: No registered users and 43 guests