pkp / classic

An official theme for OJS 3.1.1+
GNU General Public License v2.0
11 stars 27 forks source link

Only use <h1> for the logo on the homepage #26

Open sssoz opened 5 years ago

sssoz commented 5 years ago

Regarding the header.tpl template file, @NateWr commented:

<h1> should only be used on the logo for the homepage. You can see some additional logic we use for that in the default theme here:

https://github.com/pkp/pkp-lib/blob/master/templates/frontend/components/header.tpl#L41-L45

For other pages, the <h1> should usually attach to the primary heading for the page itself. So for example on the Editorial Team page it should be on the "Editorial Team" title. On an article landing page, on the article title, and so on.

Also, it's possible for the journal logo to include alt text. It's not being added here but you can see it added in the default template here:

https://github.com/pkp/pkp-lib/blob/master/templates/frontend/components/header.tpl#L55

If there is no alt text, giving the logo an <h1> will lead to an empty heading tag, which will be a SEO and accessibility issue, so we usually fall back to the journal name on the homepage.

cc @Vitaliy-1 on this comment as well. We should probably audit each of our themes to ensure the h1 and alt text is applied properly. Happy to review code if there are any questions.