"Articles" H1 tag appearing before the article title...

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.
paulawol
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed May 04, 2011 7:21 pm

Re: "Articles" H1 tag appearing before the article title...

Postby paulawol » Wed May 04, 2011 7:24 pm

getonline wrote:I've found a solution which is not a hack, but you can fix your page whitout problem.
The source is:
http://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core

Just copy PATH_TO_JOOMLA/components/com_content/views/article/tmpl/default.php file as described and modify it in your copy.

In the line 21

Code: Select all

<?php if ($this->params->get('show_page_heading', 1)) : ?>

change to

Code: Select all

<?php if ($this->params->get('show_page_heading', 0)) : ?>


Which means the deafult is false and it won't appears the H1 tag when the param isn't exists.

I hope it helps.


Thanks - this was the exact solution I was looking for as it actually means the H1 doesnt appear at all which is a good solution for me!!!!

manamaga
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Mon Jan 31, 2011 5:50 pm

Re: "Articles" H1 tag appearing before the article title...

Postby manamaga » Sun May 08, 2011 6:22 pm

Has anyone found that upgrading to 1.6.3 has fixed this? I've just upgraded but still not fixed.
Signature forum rules: viewtopic.php?f=8&t=65

tim_e
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Fri May 27, 2011 3:13 am

Re: "Articles" H1 tag appearing before the article title...

Postby tim_e » Fri May 27, 2011 3:28 am

Hi,

I believe I have SOLVED THIS PROBLEM.

I used jUpgrade to migrate my Joomla 1.5.22 site to Joomla 1.6.3. Most of the site was successfully migrated, however I noticed that H1 tags were automatically getting inserted at the top of the article content block in each of my article pages.

All the settings relating to displaying page titles (global, article, menu) were set to hidden but the H1 still appeared above my article (start of the template region for page content). However, i noticed that if I changed my article title the text in the H1 did not get updated but instead matched the current menu item title. So I assumed from this that the menu item title was what was actually being displayed inside the H1.

To verify this, I went into the Menu Manager and edited one of the Main Menu item titles and, after clearing Joomla's page cache (don't forget this step), I refreshed my equivalent article page, and hey presto, the H1 dissappeared. How bizzare!

Then to verify I wasn't going nuts, I went to another menu item in the Menu Manager, and rather than edit any properties of the menu item, I simply just clicked 'Save and Close'. Then went to the equivalent front end article page, and again, the H1 had now dissappeared.

I can only assume that this is a bug in Joomla 1.6.3 when migrating from 1.5 (or perhaps it even occurs without migrating?). I assume that each menu item's database record needs to have an update performed on it before the global/article/menu setting will actually be recognised.

Hope this helps solve other peoples problems.

User avatar
ssailow
Joomla! Apprentice
Joomla! Apprentice
Posts: 35
Joined: Tue Jul 01, 2008 10:56 pm

Re: "Articles" H1 tag appearing before the article title...

Postby ssailow » Wed Jun 08, 2011 12:19 am

mcsmom:

Thank you so much for your en-GB.override.ini solution!!

It worked for me!
Red thru Violet Web Site Works

sgodun
Joomla! Intern
Joomla! Intern
Posts: 87
Joined: Wed Sep 09, 2009 8:50 pm

Re: "Articles" H1 tag appearing before the article title...

Postby sgodun » Fri Jun 24, 2011 2:58 pm

Got a Joomla 1.6.3 installation with the same problem. This was a clean installation, no previous installation or content or anything at all. Tried everything to no avail; the only thing that works is the nonpublished menu, which sucks as a solution. Very disappointing.

nancyashaw
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Thu Jul 14, 2011 6:47 am
Location: Boston metro

Re: "Articles" H1 tag appearing before the article title...

Postby nancyashaw » Thu Jul 14, 2011 6:55 am

tritian wrote:Here is what I did to fix this:

Go to Global Configuration and Turn OFF Search Friendly URLs.
Click the menu item you created that linked to the article.
You will notice the link have an ItemID on the end
Example; "index.php?option=com_content&amp;view=article&amp;id=14&amp;Itemid=132"
You need to use that link inorder for the ugly ARTICLE up to no not appear hen you are direct linking from text or an image.


This worked for my site, thanks!!!

adlep
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Mon Aug 29, 2005 12:46 am

Re: "Articles" H1 tag appearing before the article title...

Postby adlep » Mon Aug 15, 2011 8:07 am

This same situation has happened to me with my brand new Joomla 1.7 installation. But in my case it is a reverse situation that worked:
IE:

http://tcparagliders.com/index.php?opti ... ticle&id=7
Displays the phrase "Articles" - which is not what I want.

On the other hand, switching to the URL syntax of:
http://tcparagliders.com/index.php?&view=article&id=7
Produces the expected behavior with the phrase "Articles" present in the H1 tags gone - as it should be...

As a general comment, I have been working with Joomla for few years and it seems that every new edition produces weirder and weirder bugs...
I am currently struggling with inability to perform chmod command via Filezilla - but that is a topic for another thread :)

FcoTalavera
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri Aug 26, 2011 11:49 am

Re: "Articles" H1 tag appearing before the article title...

Postby FcoTalavera » Fri Aug 26, 2011 11:57 am

editing

Code: Select all

<?php if ($this->params->get('show_page_heading', 1)) : ?>


to

Code: Select all

<?php if ($this->params->get('show_page_heading', 0)) : ?>


in \templates\jsn_epic_pro\html\com_content\article worked for me to remove the "Articles" part, i think it should be the same for the title part.

of course you should edit the files in the template you are using :P

User avatar
Batch1211
Joomla! Intern
Joomla! Intern
Posts: 85
Joined: Sat Sep 02, 2006 6:11 pm
Location: Schwerin, Germany

Re: "Articles" H1 tag appearing before the article title...

Postby Batch1211 » Sun Aug 28, 2011 6:15 pm

This is a bug, which exists for years now, and it needs to be fixed! I love Joomla, but goddammit, this bug exists for years now, and please don't tell me, this is a feature.

tomjack
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Tue Aug 30, 2011 8:52 am

Re: "Articles" H1 tag appearing before the article title...

Postby tomjack » Wed Aug 31, 2011 7:39 am

yes,you are right

randelld
Joomla! Explorer
Joomla! Explorer
Posts: 411
Joined: Thu Jan 31, 2008 8:45 am

Re: "Articles" H1 tag appearing before the article title...

Postby randelld » Thu Sep 08, 2011 11:50 am

mcsmom wrote:What you can do is make a language override ... in the languages/override folder add en-GB.override.ini

In it put
JGLOBAL_ARTICLES=""


In the meantime though you could also report it as a bug that there is no way to set the page title not to show globally.



Worked a charm.
Thanks

brianpeat
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Tue Jul 10, 2007 3:04 pm
Location: Hendersonville, TN, USA
Contact:

Re: "Articles" H1 tag appearing before the article title...

Postby brianpeat » Sat Oct 15, 2011 1:58 pm

This has mystified me since the Rocket Theme I'm using clear has code that is looking for an off/on switch. Why isn't there a "Page Heading" switch somewhere (or is there, and none of can find it!?).

Here's the code in the content html override of the template:

Code: Select all

      <?php /** Begin Page Title **/ if ($this->params->get('show_page_heading', 1)) : ?>
<!--
      <h1 class="title">
         <?php echo $this->escape($this->params->get('page_heading')); ?>
      </h1>
-->
      <?php /** End Page Title **/  endif; ?>


And you can see my comment tags to turn the display off (I didn't want to just delete it so I could see what I'd changed in the override).

So, what the heck IS the "Page Title" or "page_heading" ? And why does it show up for articles not tied to menus? Is there a global on off switch in there somewhere?
Brian Peat,
Owner, The Peat Group
http://www.thepeatgroup.com

Mab7
Joomla! Apprentice
Joomla! Apprentice
Posts: 36
Joined: Mon Jul 11, 2011 8:43 am

Re: "Articles" H1 tag appearing before the article title...

Postby Mab7 » Fri Oct 28, 2011 11:16 am

Hi
Having the exact same problem in Joomla 1.7.2
But I must say: THANKS Weric! Your solution worked ;D

weric wrote:Just use the link with the article ID only.
example: yoursiteURLhere/index.php?view=article&id=XX


Regards
Regards
Marianna Brown

User avatar
renewit
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sun Dec 18, 2011 12:31 pm
Location: Texas, USA
Contact:

Re: "Articles" H1 tag appearing before the article title...

Postby renewit » Sat Jan 07, 2012 11:58 am

Note: My interest in this matter is for creating a 404 page.

Yes, just using "/index.php?view=article&id=83" worked for sure but it made it look like my home page except it replaced the home page article with the 404 error article. ??? Kinda weird, but hey, at least there is already cool content on my 404 page now and I don't have to build another page from scratch.

If you are having this problem too, definitely report it. I don't think it's necessarily a bug, per se, more like a missing feature for odd situations that the average Joomla user might not encounter.

ns1
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Tue Feb 03, 2009 11:46 am

Re: "Articles" H1 tag appearing before the article title...

Postby ns1 » Mon Jan 09, 2012 12:37 pm

Time for me to make some small contribution.

I had a site with clean 1.7.x Joomla install. Site has 2 languages: EN i HR (my native).
on HR site there was no "article" in h1 heading. However on EN pages (the ones who were not linked as menu items) h1 with "article" showed.

Removing SEF is not a solution.
Changing language code is not a solution because it leaves blank h1 tags that still take space.

So i checked the code for template of article in
components/views/article/tmpl/default.php
and found this:

Code: Select all

<div class="item-page<?php echo $this->pageclass_sfx?>">
<?php if ($this->params->get('show_page_heading', 1)) : ?>
   <h1>
   <?php echo $this->escape($this->params->get('page_heading')); ?>
   </h1>
<?php endif; ?>


I have copied the file to my template
template/html/com_content/article/default.php
and then changed the file code from above to:

Code: Select all

<div class="item-page<?php echo $this->pageclass_sfx?>">
<?php if ($this->params->get('show_page_heading')!=0) : ?>
   <h1>
   <?php echo $this->escape($this->params->get('page_heading')); ?>
   </h1>
<?php endif; ?>


Notice that in previous code if command was set as default. I am not an php expert, but I believe that my code (copied from featured view) says
"if different from 0 than display following: h1 ... /h1"

with it I hope that I have saved an "automated" function if I want to use title tags sometime on my site I can simply turn them on in Joomla administration. I would like a confirmation on this...

Result:
h1 tags are gone.

Hope it helps...

liamhanks
Joomla! Apprentice
Joomla! Apprentice
Posts: 25
Joined: Thu May 26, 2011 6:27 pm

Re: "Articles" H1 tag appearing before the article title...

Postby liamhanks » Tue Jan 10, 2012 3:36 pm

I was also able to work around this with the following modification (Joomla! 1.7.3):
copied from

Code: Select all

components/com_content/views/article/tmpl/default.php

to

Code: Select all

(template directory)/html/com_content/article/default.php


and I commented out the lines, like so:

Code: Select all

//if (strlen($article->pageHeading))
    //echo $component->pageHeading($article->pageHeading);


Hope this helps

Znarf
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Thu Sep 10, 2009 6:41 am

Re: "Articles" H1 tag appearing before the article title...

Postby Znarf » Fri Jan 20, 2012 2:31 am

The issue is that generation of the <h1> tag is driven by the parameter
show_page_heading. This parameter is maintained by com_menus and gets assigned
a value ONLY if the page has an active menu. There is no global default, so if
there is no active menu the effect is undefined (which usually means it gets
displayed).

Solution: Introduce global default for component com_menus.

Patch 1. First enable the appropriate com_menus form fields for global
default.

open:

Code: Select all

/administrator/components/com_menus/models/forms/item_component.xml
/administrator/components/com_menus/config.xml


Then in item_component.xml find and copy the tag <fieldset
name="page-options"> and all of it's children.

Then paste them config.xml as being the first <fieldset>. This should be
line 3.

Patch 2. Let the application read and merge these settings.

open:

Code: Select all

/includes/application.php


In the method getParams() change

Code: Select all

if (is_object($menu)) {
    $temp = new JRegistry;
    $temp->loadString($menu->params);
    $params[$hash]->merge($temp);
    $title = $menu->title;
}


to

Code: Select all

if (is_object($menu)) {
    $temp = new JRegistry;
    $temp->loadString($menu->params);
    $params[$hash]->merge($temp);
    $title = $menu->title;
} else {
    // get com_menu global settings
    $temp = clone JComponentHelper::getParams('com_menus');
    $params[$hash]->merge($temp);
    // if supplied, use page title
    $title = $temp->get('page_title', $title);
}


Bonus: What this also does, is set the default page title for pages with no
active menus. This is currently by default the site name.

Usage: Log into the back-end and open the Menu Manager. On the toolbar, click
on "options". You should now see the new tab "Page Display
Options". Make your selection and save.

[submitted as bug #27779]

ns1
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Tue Feb 03, 2009 11:46 am

Re: "Articles" H1 tag appearing before the article title...

Postby ns1 » Fri Jan 20, 2012 10:53 am

Hi Znarf,

I have tried your solution but it didn't work for me. Although seems logical.
H1 tag with "Home" appears on articles that are linked in module, not menu.
For instance, I have a module that is displaying articles from category. Those articles are not linked in any menu. When I click on article title from module I get an article with it's title and with H1 title above.

perhaps your solution would work if implemented in com_content or somehting like that that controls display of articles?

ns1
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Tue Feb 03, 2009 11:46 am

Re: "Articles" H1 tag appearing before the article title...

Postby ns1 » Fri Jan 20, 2012 12:10 pm

Correction,

it seems that it is working. probably global server cache or something...

kompozitpanel
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Tue Feb 07, 2012 12:20 pm
Location: istanbul
Contact:

Re: "Articles" H1 tag appearing before the article title...

Postby kompozitpanel » Tue Feb 07, 2012 12:48 pm

khooper wrote:Here's how to remove the H1:

1. Go to the menu manager, click on the menu item that needs the H1 removed

2. Click on Page Display Options on the right.

3. Show Page Heading -> click NO

Done!


thanks my dude . good process

User avatar
PhilOSparta
Joomla! Guru
Joomla! Guru
Posts: 511
Joined: Sun Feb 25, 2007 10:44 pm
Location: New Jersey, USA
Contact:

Re: "Articles" H1 tag appearing before the article title...

Postby PhilOSparta » Wed Feb 08, 2012 3:41 pm

This bug is still evident in J 2.5.1.
Maybe it will get fixed in 2.5.2.

cyburgDOTeu
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon Feb 27, 2012 12:47 pm

Re: "Articles" H1 tag appearing before the article title...

Postby cyburgDOTeu » Tue Feb 28, 2012 9:36 am


User avatar
PhilOSparta
Joomla! Guru
Joomla! Guru
Posts: 511
Joined: Sun Feb 25, 2007 10:44 pm
Location: New Jersey, USA
Contact:

Re: "Articles" H1 tag appearing before the article title...

Postby PhilOSparta » Tue Feb 28, 2012 1:22 pm


Thanks. That worked fine.

Regards,

Phil

jdockum
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Fri Jul 23, 2010 2:31 pm

Re: "Articles" H1 tag appearing before the article title...

Postby jdockum » Wed Mar 07, 2012 10:49 pm

Znarf wrote:The issue is that generation of the <h1> tag is driven by the parameter
show_page_heading. This parameter is maintained by com_menus and gets assigned
a value ONLY if the page has an active menu. There is no global default, so if
there is no active menu the effect is undefined (which usually means it gets
displayed).

Solution: ... snipped for brevity

[submitted as bug #27779]

Fantastic work identifying and fixing this. Would be great if Joomla incorporated this.

bpbeinlich
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri Mar 16, 2012 8:11 pm

Re: "Articles" H1 tag appearing before the article title...

Postby bpbeinlich » Fri Mar 16, 2012 8:26 pm

jdockum wrote:
Znarf wrote:The issue is that generation of the <h1> tag is driven by the parameter
show_page_heading. This parameter is maintained by com_menus and gets assigned
a value ONLY if the page has an active menu. There is no global default, so if
there is no active menu the effect is undefined (which usually means it gets
displayed).

Solution: ... snipped for brevity

[submitted as bug #27779]

Fantastic work identifying and fixing this. Would be great if Joomla incorporated this.


I completely agree... great work, Znarf!

According to the bug tracker, this was fixed on 3/4/12 using Znarf's excellent patch, which worked perfectly for me. HOORAY!!!! It says it's in build 1.7.3. I'm not sure how that relates to Joomla versions.... anyone know?

alsage13
Joomla! Apprentice
Joomla! Apprentice
Posts: 39
Joined: Thu Feb 19, 2009 1:36 am

Re: "Articles" H1 tag appearing before the article title...

Postby alsage13 » Thu Apr 12, 2012 4:15 am

Because of the same problem getonline mentioned (my H1 has a background image) I was unable to use this fix:
mcsmom wrote:What you can do is make a language override ... in the languages/override folder add en-GB.override.ini

In it put
JGLOBAL_ARTICLES=""


In the meantime though you could also report it as a bug that there is no way to set the page title not to show globally.


But this worked perfectly! Cheers getonline!!!
getonline wrote:I've found a solution which is not a hack, but you can fix your page whitout problem.
The source is:
http://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core

Just copy PATH_TO_JOOMLA/components/com_content/views/article/tmpl/default.php file as described and modify it in your copy.

In the line 21

Code: Select all

<?php if ($this->params->get('show_page_heading', 1)) : ?>

change to

Code: Select all

<?php if ($this->params->get('show_page_heading', 0)) : ?>


Which means the deafult is false and it won't appears the H1 tag when the param isn't exists.

I hope it helps.

merc911
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Sat May 19, 2012 7:39 pm

Re: "Articles" H1 tag appearing before the article title...

Postby merc911 » Sat Jun 16, 2012 10:11 pm

OK, I ran into a problems editing the default.php file because I couldn't overwrite the one (/html/com_content/article) in my template folder because this was used by the template itself.

Of all the solutions i've now seen the best/easiest is:

go to : Extensions->Language Manager , then click on the Overrides tab, then select a language on the right e.g. ” English (UK) site ” and click on new and set the “Language Constant” to “JGLOBAL_ARTICLES” and leave the “text” field empty, and save&close. Do this for the remaining languages(if there are any) and it works.

Hope this helps others

SubCon
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Mon Oct 08, 2007 1:44 am

Re: "Articles" H1 tag appearing before the article title...

Postby SubCon » Thu Dec 27, 2012 1:57 am

I encountered the same problem with joomla 2.5. Some of the solutions here got me thinking that it looks like a bug and it has to do with "show_page_heading" parameter. In my case it seemed to be strange that it suddenly started appearing in new articles, but the old ones stayed as they where (no problems). So before making the override on the article template I tried something and it worked. Can't be sure it'll work for J1.6 but anyway...
Here is my solution:

Go to menu manager, go to options (button on top right), there is an option "Show Page Heading" and it probably already set to "NO". Just set it to YES and save. Then back to "NO" and save again.

It worked for me, I guess something changed this value in database or wherever else it resides. It might have happened after installing some component, sh404sef might be the one.

Good luck!

nickhine
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri Mar 29, 2013 3:48 am

Re: "Articles" H1 tag appearing before the article title...

Postby nickhine » Fri Mar 29, 2013 3:52 am

SubCon wrote:I encountered the same problem with joomla 2.5. Some of the solutions here got me thinking that it looks like a bug and it has to do with "show_page_heading" parameter. In my case it seemed to be strange that it suddenly started appearing in new articles, but the old ones stayed as they where (no problems). So before making the override on the article template I tried something and it worked. Can't be sure it'll work for J1.6 but anyway...
Here is my solution:

Go to menu manager, go to options (button on top right), there is an option "Show Page Heading" and it probably already set to "NO". Just set it to YES and save. Then back to "NO" and save again.

It worked for me, I guess something changed this value in database or wherever else it resides. It might have happened after installing some component, sh404sef might be the one.

Good luck!


Thank you so much! This worked for me on v2.5.9 :)

G Brown
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon May 20, 2013 3:31 am

Re: "Articles" H1 tag appearing before the article title...

Postby G Brown » Mon May 20, 2013 3:43 am

SubCon wrote:I encountered the same problem with joomla 2.5. Some of the solutions here got me thinking that it looks like a bug and it has to do with "show_page_heading" parameter. In my case it seemed to be strange that it suddenly started appearing in new articles, but the old ones stayed as they where (no problems). So before making the override on the article template I tried something and it worked. Can't be sure it'll work for J1.6 but anyway...
Here is my solution:

Go to menu manager, go to options (button on top right), there is an option "Show Page Heading" and it probably already set to "NO". Just set it to YES and save. Then back to "NO" and save again.

It worked for me, I guess something changed this value in database or wherever else it resides. It might have happened after installing some component, sh404sef might be the one.

Good luck!


I want to say a big 'Thank You' for this post! We had the same issue with our website. The problem is definitely related to the sh404SEF component, because disabling sh404SEF is one way to fix it.

But we couldn't just ditch sh404SEF because it creates special shortened URLs that are based on category name and article alias, rather than being based on the full menu structure.

This little change has eliminated the problems AND allowed us to keep using sh404SEF for the time being (until it causes another problem).

Thanks!


Return to “Administration Joomla! 2.5”

Who is online

Users browsing this forum: No registered users and 6 guests