Support Forum

Please note that this forum is only available to you in read only mode. In order to contribute to this conversation you will need to renew your subscription.

Change article titles to h2 headings, not h1

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

I want to change article titles so they appear as h2 headings rather than h1.

A consultant has suggested I create an override of com_content/article/default.php, with this content:

<?php if ($params->get('show_title')) : ?>
<header class="article-header clearfix">
<h2 class="article-title" itemprop="name">
<?php echo $this->escape($this->item->title); ?>
<meta itemprop="url" content="<?php echo $prefix.$url ?>" />
</h2>

Is this the best way to achieve this? Any concerns about new template releases or Joomla releases overwriting this change?

Also, couldn't this be instead entered into custom.css ?

Jim
  • glow's Avatar
  • glow
  • 3 Month Basic
  • 195 posts
  • Karma: 0
The administrator has disabled public write access.
Hi Jim,

Template overrides are unaffected by template updates (assuming its the same template of course) and are unaffected by Joomla updates

CSS is only for styling of html - (CSS) presentation and (HTML) content are kept apart

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Actually, I'm wrong

As the template override is already added you would need to re-add it when the template was updated

It would be a case of changing the existing tag to h2 from the already existing h1

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
I wanna make sure I have this right, Paul.

You're saying that after I install a template upgrade from you guys, I must edit com_content/article/default.php and re-insert the modification I made. Correct?

Jim
  • glow's Avatar
  • glow
  • 3 Month Basic
  • 195 posts
  • Karma: 0
The administrator has disabled public write access.
Hi Jim,

Yes that is correct

When you install a new version of the template you would need to add the change back to the existing override

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Thanks a bunch, Paul.

Jim
  • glow's Avatar
  • glow
  • 3 Month Basic
  • 195 posts
  • Karma: 0
The administrator has disabled public write access.
No problem

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Happy Campers