-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#2993] Use custom page title for zaak detail page #1586
base: develop
Are you sure you want to change the base?
Conversation
133a192
to
416cc73
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #1586 +/- ##
========================================
Coverage 94.22% 94.22%
========================================
Files 1075 1075
Lines 39657 39658 +1
========================================
+ Hits 37366 37368 +2
+ Misses 2291 2290 -1 ☔ View full report in Codecov by Sentry. |
{% block title %} | ||
<title>{% if page_title %}{{ page_title }}{% else %}{% trans "Aanvraag" %}{% endif %}</title> | ||
{% endblock title %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just wonder whether there's issues of having this in the inner template, for two reasons:
- The
<title>
tag will only appear in the DOM tree after the HTMX has finished loading (which can be a few seconds). I am not sure this change will be properly picked up by screenreaders and announced, but perhaps @jiromaykin knows more here. - I think
<title>
has to be a child of<head>
, having it nested under<body>
is probably not valid spec-compliant (not sure that's a show stopper, but again, it might have a11y knock-on effects).
I don't really have a better option, either then setting the title via some kind of HTMX post-load handler (doing it in the main template would defeat the purpose of the async load). Happy to merge this and address it later if it turns out to be a problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pi-sigma You are misunderstanding/mixing-up a couple of things:
- Story nr.2397 is about the META title tags and how multiple pages are missing a proper <title> there, so they can be differentiated in the browse History, for example: all of the Flat pages.
So yeah: that is a TITLE META tag that indeed needs to be part of the HEAD tag, and you will have to resarch first, which pages have Titles missing, And a <title> tag will neverbe functional inside the Body tag.
Also: the unique title needs to come first, then a hyphen after which the Sitename can appear.
So this is a bigger/different issue. - We are only using HTMX to swap and load partial components in this project, so the DOM and it's META tags are already loaded first, so no worries for screenreaders there.
- The cases status page already has a 'unique' meta title ("status") so you can either delete the stuff you made in this PR or add the status-name to the actual meta tag (not the content of the Body...).
- Is this the only PR you are making for this issue? If so: this does not tackle that issue at all.
- Oh dear, we do need to make a separate issue for the Heading-level-1 titles that do not load immediately on pageload. Which indeed is bad for accessibility, but that's completely separet from this one. So I made a new one here you do not need to worry about right now.
Taiga: https://taiga.maykinmedia.nl/project/open-inwoner/task/2993