Changing article titles from h2 heading to h1 heading
Moderator: General Support Moderators
-
- Joomla! Apprentice
- Posts: 37
- Joined: Sun Jan 30, 2011 4:52 am
Changing article titles from h2 heading to h1 heading
I am using frontpage blog layout for my site www.njteachertalk.com
It seems by default, the article titles are surrounded by h2 headings. So when I assess my site with different tools, its telling me that I do not have any h1 headings. I have tried to override the css html com_content file but it is not reflecting my changes. Still h2 headings. I have used this extension,
http://extensions.joomla.org/extensions ... JywiO30%3D
This extension actually does surround the article titles with h1 headings but it also keeps the h2 headings. So the article title drops down and the h2 empty heading remains.
How can I rectify this to take out the h2 headings and make the article titles h1 headings? Any help would be greatly appreciated.
It seems by default, the article titles are surrounded by h2 headings. So when I assess my site with different tools, its telling me that I do not have any h1 headings. I have tried to override the css html com_content file but it is not reflecting my changes. Still h2 headings. I have used this extension,
http://extensions.joomla.org/extensions ... JywiO30%3D
This extension actually does surround the article titles with h1 headings but it also keeps the h2 headings. So the article title drops down and the h2 empty heading remains.
How can I rectify this to take out the h2 headings and make the article titles h1 headings? Any help would be greatly appreciated.
- brian
- Joomla! Master
- Posts: 12787
- Joined: Fri Aug 12, 2005 7:19 am
- Location: Leeds, UK
- Contact:
Re: Changing article titles from h2 heading to h1 heading
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/
-
- Joomla! Apprentice
- Posts: 37
- Joined: Sun Jan 30, 2011 4:52 am
Re: Changing article titles from h2 heading to h1 heading
Yeah, I read this in my 2 days of trying to work this problem out. I am new to all this and still am not getting it. Anyway to shed some clarity in laymens terms what I need to do.
Thanks
Thanks
- Per Yngve Berg
- Joomla! Master
- Posts: 30970
- Joined: Mon Oct 27, 2008 9:27 pm
- Location: Romerike, Norway
Re: Changing article titles from h2 heading to h1 heading
H1 tags are used for the Page Title.
H2 tags is used for the Article Title.
I presume you have turned Page Title off.
Changing the Article Titles to H1 is probably not worth the effort.
H2 tags is used for the Article Title.
I presume you have turned Page Title off.
Changing the Article Titles to H1 is probably not worth the effort.
-
- Joomla! Apprentice
- Posts: 37
- Joined: Sun Jan 30, 2011 4:52 am
Re: Changing article titles from h2 heading to h1 heading
When I turn page title on where my home menu is located , I still get the page title enclosed in h2 headings. No h1 headings turn up. I am using frontpage blog layout.
How do I get the h1 headings for page title then?
How do I get the h1 headings for page title then?
- Per Yngve Berg
- Joomla! Master
- Posts: 30970
- Joined: Mon Oct 27, 2008 9:27 pm
- Location: Romerike, Norway
Re: Changing article titles from h2 heading to h1 heading
In fact J1.5 do show the Page Title in a div. No h tags at all. J1.7 uses h1 tags.
Is there a frontpage folder under your template's html folder?
Here is the core's code for the Page Title
Is there a frontpage folder under your template's html folder?
Here is the core's code for the Page Title
Code: Select all
<?php if ($this->params->get('show_page_title', 1)) : ?>
<div class="componentheading<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
<?php echo $this->escape($this->params->get('page_title')); ?>
</div>
<?php endif; ?>
-
- Joomla! Apprentice
- Posts: 37
- Joined: Sun Jan 30, 2011 4:52 am
Re: Changing article titles from h2 heading to h1 heading
Yes, there is a frontpage folder under the template html folder. So I took that code and pasted it in the html frontpage folder. The title pops up with the h1 headings above the actual box with the title. Am I suppose to now just style it the way I want through the template css folder?
See what I mean: (the white text, Welcome NJ Teachers)
http://www.njteachertalk.com/
So if 1.5 doesn't use h1 tags, is it that important to have them? Is it fine in terms of SEO to just have the h2 tags surrounding the article titles? and the h2 tags surrounding the page title?
See what I mean: (the white text, Welcome NJ Teachers)
http://www.njteachertalk.com/
So if 1.5 doesn't use h1 tags, is it that important to have them? Is it fine in terms of SEO to just have the h2 tags surrounding the article titles? and the h2 tags surrounding the page title?
- Per Yngve Berg
- Joomla! Master
- Posts: 30970
- Joined: Mon Oct 27, 2008 9:27 pm
- Location: Romerike, Norway
Re: Changing article titles from h2 heading to h1 heading
Why not put a H1 tag here:
Code: Select all
<span class="breadcrumbs pathway">
Welcome to NJTeacherTalk. A place where NJ educators can let their voices be heard. Simply register to submit your own articles and editorials for posting. Participate. Discuss. Research. Network. Socialize.</span>
-
- Joomla! Apprentice
- Posts: 37
- Joined: Sun Jan 30, 2011 4:52 am
Re: Changing article titles from h2 heading to h1 heading
That would be great? How do I do that?
- Per Yngve Berg
- Joomla! Master
- Posts: 30970
- Joined: Mon Oct 27, 2008 9:27 pm
- Location: Romerike, Norway
Re: Changing article titles from h2 heading to h1 heading
How did the text got there?
It looks like a module.
It looks like a module.
-
- Joomla! Apprentice
- Posts: 37
- Joined: Sun Jan 30, 2011 4:52 am
Re: Changing article titles from h2 heading to h1 heading
Yeah, the breadcrumbs module. Still not sure how I surround that with h1 tags?
-
- Joomla! Apprentice
- Posts: 37
- Joined: Sun Jan 30, 2011 4:52 am
Re: Changing article titles from h2 heading to h1 heading
Per, ya still there? Any guidance with how to surround breadcrumbs text with h1 tags?
- Per Yngve Berg
- Joomla! Master
- Posts: 30970
- Joined: Mon Oct 27, 2008 9:27 pm
- Location: Romerike, Norway
Re: Changing article titles from h2 heading to h1 heading
It's not the Breadcrump module. It would have display "You are here: Home"
Is there some other module published in the Breadcrump-path position?
Is there some other module published in the Breadcrump-path position?
-
- Joomla! Fledgling
- Posts: 3
- Joined: Thu Jan 31, 2013 12:11 pm
- Location: Montpellier, France
- Contact:
Re: Changing article titles from h2 heading to h1 heading
Hi guys.
I know the topic isn't fresh, but it came out while I was looking to solve the same issue on a Joomla 2.5.7 ... I found a good and clean method here :
http://www.itoctopus.com/how-to-change- ... -in-joomla
I thought it'd be nice to share it. i tried option N°3 and it worked just fine.
I know the topic isn't fresh, but it came out while I was looking to solve the same issue on a Joomla 2.5.7 ... I found a good and clean method here :
http://www.itoctopus.com/how-to-change- ... -in-joomla
I thought it'd be nice to share it. i tried option N°3 and it worked just fine.
-
- Joomla! Apprentice
- Posts: 6
- Joined: Thu Feb 07, 2013 10:46 am
Re: Changing article titles from h2 heading to h1 heading
yeah i think its not a good idea to change h2 tittle of article to h1.Per Yngve Berg wrote:H1 tags are used for the Page Title.
H2 tags is used for the Article Title.
I presume you have turned Page Title off.
Changing the Article Titles to H1 is probably not worth the effort.
it has no effort in the new method of google.
-
- Joomla! Ace
- Posts: 1733
- Joined: Mon Nov 13, 2006 8:01 pm
- Contact:
Re: Changing article titles from h2 heading to h1 heading
I was also looking for a way to change my H2 tags to H1 and I came across this fantastic plug-in. No need to hack into the core or change anything within the template. It's really good. So if you ever change your template and you find that the page headings revert back to h1 tags, you can simply remove the plug-in.
http://www.conflate.nl/joomla-extensions.html
http://www.conflate.nl/joomla-extensions.html
Ham and eggs. A day's work for a chicken, a lifetime commitment for a pig.
http://www.tetraplegicliving.com
http://www.oscarfishlover.com
http://www.tetraplegicliving.com
http://www.oscarfishlover.com
-
- Joomla! Fledgling
- Posts: 2
- Joined: Thu May 10, 2012 7:34 am
Re: Changing article titles from h2 heading to h1 heading
Perfect for everyone I guess, thanks!
LaurentNeuville wrote:Hi guys.
I know the topic isn't fresh, but it came out while I was looking to solve the same issue on a Joomla 2.5.7 ... I found a good and clean method here :
http://www.itoctopus.com/how-to-change- ... -in-joomla
I thought it'd be nice to share it. i tried option N°3 and it worked just fine.
-
- Joomla! Apprentice
- Posts: 8
- Joined: Sun May 29, 2011 1:35 pm
Re: Changing article titles from h2 heading to h1 heading
The way I do this in my template's html/com_content/article/default.php:
So, an override, just like Brian pointed out.
Edit: Removed "textshadow" class from h1 - that was just from a specific template.
Code: Select all
<? // changed div to article ?>
<article class="item-page<?php echo $this->pageclass_sfx; ?>" >
<?php if ($this->params->get('show_page_heading', 1)): ?>
<h1 role="heading" aria-level="1"><?php echo $this->escape($this->params->get('page_heading')) ; ?></h1>
<?php endif; ?>
<?php if (!empty($this->item->pagination) && $this->item->pagination && !$this->item->paginationposition && $this->i tem->paginationrelative) {
echo $this->item->pagination;
} ?>
<?php // changed from static h2 ?>
<?php if ($params->get('show_title')): ?>
<?php if ($this->params->get('show_page_heading', 1)): ?>
<h2 role="heading" aria-level="2">
<?php else: ?>
<h1 role="heading" aria-level="1">
<?php endif; ?>
<?php if ($params->get('link_titles') && !empty($this->item->readmore_link)): ?>
<a href="<?php echo $this->item->readmore_link; ?>"><?php echo $this->escape($this->item->title); ?></a>
<?php else : ?>
<?php echo $this->escape($this->item->title); ?>
<?php endif; ?>
<?php if ($this->params->get('show_page_heading', 1)): ?>
</h2>
<?php else: ?>
</h1>
<?php endif; ?>
<?php endif; ?>
Edit: Removed "textshadow" class from h1 - that was just from a specific template.
-
- Joomla! Apprentice
- Posts: 12
- Joined: Wed Sep 16, 2015 2:42 am
- Location: Chicago
- Contact:
Re: Changing article titles from h2 heading to h1 heading
<bump>
Has anyone found out a plug-in or another way to accomplish editing the title of a blog post?
Has anyone found out a plug-in or another way to accomplish editing the title of a blog post?
- Per Yngve Berg
- Joomla! Master
- Posts: 30970
- Joined: Mon Oct 27, 2008 9:27 pm
- Location: Romerike, Norway
Re: Changing article titles from h2 heading to h1 heading
Edit the Page Title on the menu item.
- bhaumik
- Joomla! Apprentice
- Posts: 20
- Joined: Fri May 18, 2012 6:24 am
Re: Changing article titles from h2 heading to h1 heading
Instead of spending time on searching for configuration, I used this trick.brian wrote:You need to override the template view
http://docs.joomla.org/How_to_override_ ... omla!_core
Thanks,
-
- Joomla! Apprentice
- Posts: 12
- Joined: Tue May 30, 2017 6:30 am
Re: Changing article titles from h2 heading to h1 heading
All you need to do is create a Joomla System plugin that only works on the frontend and that has the following code at heart:
function onAfterRender()
{
$app = &JFactory::getApplication();
if($app->isAdmin() || JDEBUG) {
return;
}
$body = JResponse::getBody();
str_replace('h2>', 'h1>', $body);
JResponse::setBody($body);
}
The problem with the above method, however, is that you won’t be able to use h2 tags anymore anywhere – which makes it less than ideal. Another problem is that you will be using a plugin, thus creating extra overhead on the rendering of the page.
function onAfterRender()
{
$app = &JFactory::getApplication();
if($app->isAdmin() || JDEBUG) {
return;
}
$body = JResponse::getBody();
str_replace('h2>', 'h1>', $body);
JResponse::setBody($body);
}
The problem with the above method, however, is that you won’t be able to use h2 tags anymore anywhere – which makes it less than ideal. Another problem is that you will be using a plugin, thus creating extra overhead on the rendering of the page.