ckan / ckan

CKAN is an open-source DMS (data management system) for powering data hubs and data portals. CKAN makes it easy to publish, share and use data. It powers catalog.data.gov, open.canada.ca/data, data.humdata.org among many other sites.
https://ckan.org/
Other
4.43k stars 1.98k forks source link

HTML headings are inconsistent within and across dataset/group/org views #7959

Open toothstone opened 10 months ago

toothstone commented 10 months ago

CKAN version

2.10

Describe the bug

HTML headings are inconsistent in several places, mostly where snippets are (re-)used at different hierarchy levels. This constitutes an accessibility issue as screen readers rely on HTML semantics.

Steps to reproduce

Open e.g. https://demo.ckan.org/dataset/sample-dataset-1 - it has 3 h1-headings:

Open https://demo.ckan.org/organization/sample-organization - it has 2 h1-headings

(also applies to groups: https://demo.ckan.org/group/my-group)

However, the "X datasets found" snippet currently needs to use h1, as it is also used for e.g. the dataset search, e.g. https://demo.ckan.org/dataset/?q=sample&sort=score+desc%2C+metadata_modified+desc, which has no other headings.

Expected behavior

All CKAN pages follow HTML heading best practices in their headings:

Implementation ideas

I found that the finnish open data portal has a nice CKAN skin that solves most (not all) of these issue (https://www.opendata.fi). I haven't looked into their implementation, but they found some nice conventions that CKAN could borrow from:

Besides that, requiring all snippets that set HTML headings to accept an 'parent heading level' (N) might be a way forward. All snippets could then set their heading levels algorithmically, starting at N+1.

Comments

I'm aware that this is a very complex issue, as any major changes might mess with customized installations in unexpected ways, especially if those rely on the current snippets.

I'm not sure how work has been done regarding the general UI overhaul in #7760, which will probably make this issue obsolete, but I felt it best to track this separately.

If it is in the interest of the community and maintainers, I can maybe get some funding for a PR.

pdelboca commented 10 months ago

Thanks @toothstone for the issue and the level of detail.

As you mentioned, we are planning a UI revamp in 2024 for CKAN 3.0 in which we will break things in pursue of an major improvement.

I'm adding the UX tag to this issue since it is a good documentation and input for the work that's gonna be done in the next months. This will allow us to can keep track of suggestions from the community.

cc @thegostev