0

On all my Joomla pages I have the articles title as the h1 tag, so until now, Joomla has always displayed the title, i.e. what you see on the browser tab as the h1 tag. (There were one and the same thing).

However, this is not the case with all the pages that have no menu item linking to them, (they are linked to the rest of the site through another article). Here the name of my site is the page title.

How do I make the h1 tag the page title on these pages?

2 Answers 2

0

Try this,

This is happen due to those article pages meta options have title, Meta tag and keywords those are blank or not set yet. Then this case Joomla will read those info from your Global settings It may have your site name and Global description.

So the solution is set the Proper meta info for those articles from article manager.

If it is not practical then you can try it from article view or layout page Set meta data of Joomla page

enter image description here

Second Method is for setting the page title forcefully from scripts. It used for any components like here you have to check first method it will work for you..

Hope its Helps..

3
  • Those are empty indeed, however, there is no title option, the only things I can fill in are description, keywords, etc. but no title. The thing with the other method proposed is that I have to do it manually every time right? I though one could include the following in the template index: <title><? php echo $this->baseurl?>/article path/h1</title> My php skills are limited but the idea is to get the h1 title from the article and set it as title, would that work? Also, why do I get a page title on all the pages that have a menu item associated? I did not enter any title for them anywhere.
    – user2933885
    Jan 8, 2014 at 15:27
  • check the article options section show title is that set to Use Global or Show ? make it to Show. then article title will show as page title. Same option will be available on menu that are showing properly may set correctly.You can set this for all article at one place. Go to article manager -> tool bar Options->title.
    – Jobin
    Jan 8, 2014 at 15:42
  • From what I understand, you say I should change the show title option in the article manager options from hide to show? The problem is that it was already on show...
    – user2933885
    Jan 8, 2014 at 15:54
0

Problem solved! Here is how:

Make an override of com_content article and edit the default.php. Around lines 42/43 you should have the following code (the line number may not be exact as I have already taken out some code for a previous override):

<?php if ($params->get('show_title') || $params->get('show_author')) : ?>

Straight after that, add the following lines of code:

<?php $document=& JFactory::getDocument();
$document->setTitle( $this->item->title ); ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.