?
avatar b2z
b2z
28 Jul 2020

Steps to reproduce the issue

Simple test on articles. Set "Show Page Heading" option to "No". Open an article.

Expected result

Article should have H1 tag.

Actual result

Article has H2 tag. So page has H2 tag, but there is no H1 tag.

Additional comments

The most correct behavior should be as follows: if there is no page heading then the item title has H1 tag. If there is a page heading then the item title has H2 tag.

Of course, we can technically have whatever we want, but logically we should have one H1, then as many H2, H3, H4 as make sense. They should be properly nested. There is probably no any SEO issues for not doing it right, but it may cause some accessibility issues for screen readers.

There is a very easy fix for that and I am ready to make a PR. Here you can find the example of override for article view to display the correct headings.

avatar b2z b2z - open - 28 Jul 2020
avatar joomla-cms-bot joomla-cms-bot - change - 28 Jul 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 28 Jul 2020
avatar chmst
chmst - comment - 28 Jul 2020

Of course there are many different use cases. Somtimes Templates have an h1 tag in the banner, and so on. But it sounds good for me. A PR would be appreciated :)

avatar ReLater
ReLater - comment - 29 Jul 2020

It sounds bad for me and has already been discussed in the past.

There are too many cases where an automatism like proposed is creating just unforeseeable chaos. And it would be another B\C break.

In this case I am the one saying: "Use your override if you want to" ;-)

avatar richard67
richard67 - comment - 29 Jul 2020

See also old, closed PR #11772 for old discussion.

avatar b2z
b2z - comment - 29 Jul 2020

Well then we can make it against J4?

avatar richard67
richard67 - comment - 29 Jul 2020

Not sure ... ping @wilsonge .

avatar b2z
b2z - comment - 31 Jul 2020

Good article about H1 tags. If we do care about a11y then H1 tag should be placed on the page.

avatar brianteeman
brianteeman - comment - 31 Jul 2020

Its not about h1 being a good idea. We all agree with that. The issue is can you "automatically" do it.

One method I have seen some components do is to count the current h level and then the next is h+1

avatar b2z
b2z - comment - 31 Jul 2020

What's bad in auto? It's counting only within item layout and only between H1 and H2 tag.

avatar chmst
chmst - comment - 1 Aug 2020

If someone decides, for example, to set the h1 manually on a site, (i.e. via a custom module with a specially designed headline), he needs an extra override to get rid of this automatism.

avatar b2z
b2z - comment - 1 Aug 2020

If someone decides, for example, to set the h1 manually on a site, (i.e. via a custom module with a specially designed headline), he needs an extra override to get rid of this automatism.

But now you need to make an override to get H1 in place when there is no page heading.

Well it's up to you boys and girls. Ping me if you will decide to make a PR for this.

avatar sergeytolkachyov
sergeytolkachyov - comment - 1 Aug 2020

Let's see on clean Joomla installation, without page builders, studio's templates etc. Very often settings is Page heading (from menu item) is only in blog category, but not in article. Why do I have an article page without H1 tag? And why should I make an override core files in template if it should be a nice core feature? It's not difficult for me, but it would be taking care about ordinary joomla users. Not all of them are developers, but they have a right to have a good SEO site.

avatar alikon
alikon - comment - 1 Aug 2020

@sergeytolkachyov
so why not do yuo propose a pull request ?
all pull request is very welcomed

avatar b2z
b2z - comment - 1 Aug 2020

@sergeytolkachyov
so why not do yuo propose a pull request ?
all pull request is very welcomed

Because I am proposing it ;) But first wanted to get some feedback on it. Currently people seems does not support it.

avatar alikon
alikon - comment - 1 Aug 2020

maybe i'm wrong and I cannot guarantee you nothing regarding the pr acceptance
but it's always best to propose a solution via pr (for the j4 branch)
if you already have 1

avatar alikon alikon - change - 1 Aug 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-08-01 09:46:00
Closed_By alikon
avatar alikon alikon - close - 1 Aug 2020
avatar b2z
b2z - comment - 1 Aug 2020

I do not have it. I have a solution, but why should I make spare my free time to make a PR that probably won't be accepted? While we will be discussing I will need to merge upstream and make my branch up to date and again this will take some time.

I made this issue to listen for a feedback and at the moment I see that people does not want this improvement in J4. Or this is closed to early. Why not to discuss and then make a PR?

As I said, ping me when you will be ready for this improvement and I will make a PR.

Add a Comment

Login with GitHub to post a comment