Elxis CMS Forum

Support => Elxis 4.x/5.x DEV => Topic started by: kyomar on July 17, 2013, 11:11:17

Title: Separate page title for homepage and other pages
Post by: kyomar on July 17, 2013, 11:11:17
Hi,

some of my page titles are getting a little bit too long and repetitive. Is it possible to have a unique title for the homepage and then different title constructions for all other pages with the possibility to add a prefix and/or appendix? An example:

Homepage title: best cms on the planet - elxis4
Other pages title w/ prefix: elxis4 (prefix) - read our wiki page (articles title)

As it works now the article's title is shown in front (prefix) of the homepage title (site name).
Example: read our wiki page - best cms on the planet - elxis4

I think this would give us more flexibility in creating more meaningful and seo friendly page titles.

Thank you!
Title: Re: Separate page title for homepage and other pages
Post by: kyomar on July 24, 2013, 03:15:55
Hi, This seems to be of no interest or I didn't explain the matter clearly enough. Anyway, whenever I ask something seo related I am not getting any comments. For example I asked a while ago why site name is added to all meta descriptions which makes the descriptions sometimes very long.

I try to be a part of the elxis community and help to improve further an already very good product.

Thank you.
Title: Re: Separate page title for homepage and other pages
Post by: kyomar on July 26, 2013, 08:54:30
Hey guys, I really need help with this. I am stuck with the creation of the page titles. I had a look at isopensource.com and the page titles are exactly how I would like to have my page titles (see first post). Can please somebody have a look at my titles @ koyuki-hakuba.com.

Thanks a lot!
Title: Re: Separate page title for homepage and other pages
Post by: kyomar on July 30, 2013, 03:24:23
I am still working on this. It's a pitty nobody seems to be able to help how to build page titles seen in the web browsers title bar.
I guess the problem is that I don't have an article in my frontpage, only modules which are allocated to frontpage cells. I tried mod_articles instead of mod_content but it doesn't change anything as module titles are h2 whereas article titles are h1 and only h1 are used to build page titles. Or is there another way to build a frontpage title besides site name?

Any help would be really appreciated!

Thank you!
Title: Re: Separate page title for homepage and other pages
Post by: datahell on July 30, 2013, 09:35:48
https://www.elxis.net/docs/developers/libraries/elxisdocument.html
Title: Re: Separate page title for homepage and other pages
Post by: kyomar on July 31, 2013, 03:24:39
thank you very much datahell. The elxis documentation is excellent. I just didn't know where to look; didn't check developers :-(. Where do I have to insert $eDoc->setTitle('My custom title'); to change only frontpage title?
Title: Re: Separate page title for homepage and other pages
Post by: webgift on August 01, 2013, 10:02:00
I think that the document title of the frontpage is your sitename. Site name can be changed from Administrator area -> Settings -> General -> Site name
Title: Re: Separate page title for homepage and other pages
Post by: kyomar on August 01, 2013, 11:00:36
Thank you webgift!

I know that the site name is used for the frontpage title as well as for all other pages title (us appendix) which is exactly my problem. My page titles are getting too long and repetitive because of the site name being added. Unfortunately we don't have something like a prefix or/and appendix field which could be used for the creation of all other pages and the site name is only used for the frontpage title. Please read my first post as well.
Title: Re: Separate page title for homepage and other pages
Post by: webgift on August 01, 2013, 12:38:59
Note: Below i am going to quote you some actions which are not recommended at all. You do that for your own responsibility ok?
Folder: components/com_content/controllers
PHP file: fpage

Search for : $eDoc->setTitle($elxis->getConfig('SITENAME'));
$elxis->getConfig('SITENAME') is your site name description.
- Depending the tasks you wish to change the document's title you have to edit the relative controller each time.
Title: Re: Separate page title for homepage and other pages
Post by: datahell on August 01, 2013, 12:39:46
Elxis uses the site name you have set in Elxis configuration as page title in frontpage, this is the recommended option for SEO.

If you want to change that open file:
components/com_content/controllers/fpage.php
Go to line 44:
$eDoc->setTitle($elxis->getConfig('SITENAME'));
and change it to what ever you like:
$eDoc->setTitle('Something very custom');

If you write non-latin characters make sure to save fpage.php file as UTF-8 without BOM.
Title: Re: Separate page title for homepage and other pages
Post by: webgift on August 01, 2013, 12:41:20
:) We wrote at the same time!
Title: Re: Separate page title for homepage and other pages
Post by: kyomar on August 01, 2013, 13:45:25
Yeah, that's it. Many thanks webgift and datahell.

Now the site name is being used as appendix for all page titles and the front page title is "hard coded". I still believe it would be great if one could define a prefix and/or appendix for the page titles and the site name is only used for the front page title.

Have a nice day!
Title: Re: Separate page title for homepage and other pages
Post by: webgift on August 01, 2013, 15:20:19
You are welcome, Kyomar.
The thread you've sent me above has been deleted in order avoid any misunderstanding for community members. Ok?
Have a nice day too.
Title: Re: Separate page title for homepage and other pages
Post by: kyomar on January 25, 2014, 09:56:53
Hi, sorry I have to bring this topic up again. I have changed the title creation as suggested by datahell and it works great. But now suddenly google displays wrong page titles. The site name is displayed twice but slightly different on each page (except homepage, which is correct).
Example with site name "company name":
site title - company name - company name + town

Any ideas why? Did google mess up?

Thanks for any feedback,
Markus
Title: Re: Separate page title for homepage and other pages
Post by: datahell on January 25, 2014, 10:17:57
Each page is a different case. The extensions controls each page separately to set proper title and meta tags.
I told you how to set the title, whether you set a good title or not, is an other discussion...
I advise you to set a proper site name in Elxis configuration and let everything else be handled by Elxis.
Title: Re: Separate page title for homepage and other pages
Post by: kyomar on January 26, 2014, 00:45:39
Thank you datahell for your prompt reply - very appreciated. I have set proper title and meta tags but somehow google (bing shows the correct titles) adds an extra piece at the end. I have never set "site name something" only "site name".
The title should be:
> page title - site name
but in google I get:
> page title - site name - site name something

I think google messed it up :-(
Title: Re: Separate page title for homepage and other pages
Post by: webgift on January 27, 2014, 10:37:26
I think that such an article (http://blog.powermapper.com/blog/post/Page-Title-Length-for-Search-Engines.aspx) might help you about the page title length for search engines!