Display article title as page title in browser

Need help with the Administration of your Joomla! 2.5 site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
boxportable
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Feb 27, 2013 4:58 pm

Re: Display article title as page title in browser

Post by boxportable » Fri Mar 08, 2013 11:55 am

Sorry to necro an old thread but thank you so much DeanMarshall your solution is exactly what I needed.

I should note that it appears that on my "Home" button which is linking to a featured article this problem persists but its only 1 page so its fine.

OpenGlobal
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Sat Mar 30, 2013 9:55 am

Re: Display article title as page title in browser

Post by OpenGlobal » Sat Mar 30, 2013 9:58 am

This is definitely a bug (or rather a bug in the design because it's clearly "as designed") and is STILL present in 2.5.6.

Here is a more complete fix because it takes into account the Browser Page title override in the menu, just in case you do ever want to use that. And it takes into account the site configuration setting to prefix or suffix the site title too:

Code: Select all

// Fix Joomla 1.6+ title bug
$app = JFactory::getApplication();
$menu = $app->getMenu();
$menuTitleOverride = $menu->getActive()->params->get('page_title');

$config =& JFactory::getConfig();
$prefixSuffix = $config->getValue( 'config.sitename_pagetitles' );

$document=& JFactory::getDocument();
$document->setTitle( (1 == $prefixSuffix ? $config->getValue( 'config.sitename' ).' - ' : '') . ($menuTitleOverride ? $menuTitleOverride : $this->item->title) . (2 == $prefixSuffix ? ' - '.$config->getValue( 'config.sitename' ) : '') );
OpenGlobal

OpenGlobal
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Sat Mar 30, 2013 9:55 am

Re: Display article title as page title in browser

Post by OpenGlobal » Sat Mar 30, 2013 10:19 am

I'd also suggest adding the same code into a template override of of the category blog.php but replace $this->item->title with $this->category->title

OpenGlobal

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 39126
Joined: Sat Apr 05, 2008 9:58 pm

Re: Display article title as page title in browser

Post by Webdongle » Sat Mar 30, 2013 10:36 am

Interesting to note that with Meta data options then the keywords and description entered in the menu item do not override those in the Article.

Also it does seem poor logic that when a field is left blank(like the Browser title field in the menu item) is left blank that the original setting in the Article is overridden by a different setting in the menu item.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"The definition of insanity is doing the same thing over and over again, but expecting different results": Albert Einstein.

jamescobalt
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sat Aug 31, 2013 3:03 am

Re: Display article title as page title in browser

Post by jamescobalt » Sat Aug 31, 2013 3:08 am

This is how I "fixed" it. For my Home menu item, I simply deleted the browser page title.

I then renamed the menu title with what was in my browser title field so my homepage would have my optimized title.

sahil5684
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Mon Aug 05, 2013 1:04 pm

Re: Display article title as page title in browser

Post by sahil5684 » Mon Sep 02, 2013 2:45 pm

Dean!!!!

You are my herooooooooo!!! :)

Thomsterdam
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 111
Joined: Mon Dec 12, 2011 5:55 pm

Re: Display BLOG article title as page title in browser

Post by Thomsterdam » Sat Oct 11, 2014 10:00 am

Hi there,

This poor old forum item gets revisited and reopened yet again.

I have a slightly modified question. My website has a category blog as the home page. I would like the title of the first article in the category to be the Browser Page Title (BPT).
Of course I can go ahead and change it manually in the menu item every time I post an article that is going to be the first on the page. That takes extra effort and time. So I was wondering: is it possible for Joomla to post it there automatically. (I always try to automate dumb chores).

Point in case: the website is a church website and I would like the news about the next church service (which is the first item on the front page) to show up in the BPT.
The reason for this is that when I post the news on Facebook and add a link to the church website the BPT is picked up by Facebook. Till now the menu BPT was "latest news about our upcoming church service" so that was what was showing in Facebook.
You can imagine it is more interesting if that would read something like: "Pastor John speaks on the Sermon on the Mount" instead.


Any ideas?

Thanx a million,


Thom
PS: if it makes any difference: I work with Joomla 3.3.6
Give a man a fish and you feed him for a day;
teach a man to fish and you feed him for a lifetime.

secrets
I've been banned!
Posts: 109
Joined: Sat Aug 10, 2013 9:07 am

Re: Display article title as page title in browser

Post by secrets » Sat Oct 11, 2014 10:05 am

sh404sef does this for you.

Thomsterdam
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 111
Joined: Mon Dec 12, 2011 5:55 pm

Re: Display article title as page title in browser

Post by Thomsterdam » Sat Oct 11, 2014 10:35 am

Hi there "secrets",

Could you elaborate?

Thanx,


Thom
Or anyone else who can shed more light on my question?
Give a man a fish and you feed him for a day;
teach a man to fish and you feed him for a lifetime.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 39126
Joined: Sat Apr 05, 2008 9:58 pm

Re: Display article title as page title in browser

Post by Webdongle » Sat Oct 11, 2014 12:43 pm

That extension Would be imho an 'overkill' for what you need Because it deals with SEF url's as well as meta data.

Would advice creating a backup with Akeeba. Then make a copy of the site and test extensions on the copy before installing on a live site.

http://extensions.joomla.org/extensions ... -data/7124 may be nearer what you need there are others http://extensions.joomla.org/extensions ... /meta-data
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"The definition of insanity is doing the same thing over and over again, but expecting different results": Albert Einstein.


Locked

Return to “Administration Joomla! 2.5”