Skiplink to next post (accessibility)

These RFCs were either rejected or have been replaced by an alternative proposal. They will not be included in phpBB.
Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: Skiplink to next post (accessibility)

Post by Oleg »

We already have anchors for each post in the topic. If they can be reused as skiplink targets, this might be the solution I would prefer. Then perform an extra pass over the posts' data before assigning it to template to set the skiplink target for each post. The last post's skiplink should go to the top? Or next page?

philwhite
Registered User
Posts: 18
Joined: Fri Dec 28, 2012 3:09 pm

Re: Skiplink to next post (accessibility)

Post by philwhite »

Yes, that was my initial idea. But it would need the extra pass in viewtopic.php (and viewforum, and pretty well anywhere that block variables are passed).

The existing anchor is, however, in the wrong place for a screenreader. The anchor needs to be immediately before the title in each post (or, as bruno suggested above, before the poster's name), otherwise the screenreader starts at the profile icons (warn, report ,quote, etc. depending on permissions), which is exactly we are trying to avoid.

Indeed, that order is pretty nonsensical for a screenreader anyway. If I am listening in sequence, I am given the chance to report the post or quote it before I have read it.

philwhite
Registered User
Posts: 18
Joined: Fri Dec 28, 2012 3:09 pm

Re: Skiplink to next post (accessibility)

Post by philwhite »

Just to recap, if it were possible to manipulate the block variable in the template

Code: Select all

<a href="{[color=#FF4000]postrow.POST_NUMBER + 1[/color]}"
my most recent suggestion would work without any changes to the PHP code. It's just a question of restyling.

Also, passing an extra template variable POST_NEXT_NUMBER, containing POST_NUMBER +1 is a far more trivial programming task than a second pass.

Oleg
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am
Contact:

Re: Skiplink to next post (accessibility)

Post by Oleg »

philwhite wrote:Just to recap, if it were possible to manipulate the block variable in the template

Code: Select all

<a href="{[color=#FF4000]postrow.POST_NUMBER + 1[/color]}"
my most recent suggestion would work without any changes to the PHP code. It's just a question of restyling.
phpbb does not allow math in templates to my knowledge, it has to go into php code.

At this point someone needs to write a patch.

philwhite
Registered User
Posts: 18
Joined: Fri Dec 28, 2012 3:09 pm

Re: Skiplink to next post (accessibility)

Post by philwhite »

I suddenly feel very foolish!

I have just noticed that, for the postrow loop at least, "U_NEXT_POST_ID" is already passed. I should be able to hook into this. If this does the job, the entire project becomes one of templating rather than coding This means that I can potter away at a new template in my own time. However, something similar would also need to be done to allow users to navigate through index.php and viewforum.php.

As I have said, I am no programmer, and am partially-sighted myself and liable to make mistakes. I can, however, investigate the entire issue over the coming months and report back with a detailed proposal if there is any interest in pursuing this long-term.

In the short term, even the opportunity of writing a template for viewtopic would be a great boon to screen reader users.

Please let me know whether anybody is interested in pursuing this and I shall try to identify any areas in which code changes need to be made.

My apologies if I have rather wasted your time!

philwhite
Registered User
Posts: 18
Joined: Fri Dec 28, 2012 3:09 pm

Re: Skiplink to next post (accessibility)

Post by philwhite »

Still thinking about this. Because I shall need language files for all the messages and so on, it would probably make sense to turn this into a simple MOD.

That way, an additional user profile entry could be defined, for instance "accessibility_type", with one of three values " normal¦screenreader¦keyboard". This could be set on registration (default ="normal") and could be modified in the UCP.

Depending on the setting, which would be passed to the template, skip links would be suppressed, inserted as offscreen elements or inserted as visible links for keyboard users.

Extensive screen reader texts could then be made available to guide users (, for instance "This topic has nn posts on nn pages. <link> Read from top</link><link>Read first unread post</link><link>Go to last post</link>

When the mod is robust, it could be considered for inclusion in the core code.

Initially, I shall proceed in this way and see how we go!

philwhite
Registered User
Posts: 18
Joined: Fri Dec 28, 2012 3:09 pm

Re: Skiplink to next post (accessibility)

Post by philwhite »

This has gone extremely well. In essence, the modification is very simple and requires only minor changes to the php code. I have currently implemented a working version for viewtopics, which is the most important page. The viewforum and index pages would need to be modified in much the same way, but I do not foresee any significant difficulties. The most difficult pages to modify will be the search pages and the UCP.

The approach I have adopted is as follows:
  • Create a new custom profile field as a drop-down list with four items:
    Default
    Screen reader verbose
    Screen reader
    Keyboard
  • This custom field is mandatory and presented at registration
  • Default and Screen reader verbose are identical
    the rationale behind this is that unregistered visitors (who may be using screen readers) will have the (invisible) screen reader support available to them. The reason that I have included Default is purely psychological.
  • All the additional links and information provided is invisible to bots
  • The various PHP files are modified to provide an additional variable to the templates containing the number (not the ID) of the next item in a block (possibly also the previous number in the block. This is a trivial edit (current number +1 / -1)
  • The screen reader and keyboard options are essentially identical, the only difference being that all the additional links are visible for keyboard users. Screen reader verbose announces the block of links with "quick navigation links for screen readers" and announces "end of quick navigation links" at the end of the links.
  • The links currently provided in viewtopics are as follows:
    • Skip to next post (if there is one)
    • Read poster profile
    • Actions for this post (takes the user to the "warn, quote, edit, etc, buttons, if available)
    • Go to board Index
    • Search the board
    • Search this topic
  • If the post is the last post, this is announced and the "Skip to next post" link is suppressed
This approach provides quick and efficient navigation links that are only a few TABs away from anywhere on the board.

There are some issues still to be resolved, such as the handling of posts from foes, which interrupt the normal flow of sequential row numbers. (I assume that friends and foes has been implemented by visibility attributes, which means that they are visible to screen readers anyway. The problem will be with keyboard users.

I have already demonstrated to myself that this approach is extremely efficient and quickly implemented. After I returned from a short break, I shall put up a demonstration board and ask a colleague who uses a screen reader to test drive it for me. I shall then report back here and start implementing the necessary changes to the remaining templates.

Because the additional information essentially occurs once per row, there will often be only a handful of edits in each template and most of these will be the insertion off a single block.

Implementation of this as a mod differs from implementation in the core code only insofar as the profile field would be a standard profile field rather than a custom profile field. Since the default setting for this profile field enables the screen reader functions, most users will be able to register without making any changes to the drop-down list, and the screen reader information is still available, but invisible to users who are not using a screen reader.

As I said, it will be a few weeks before I can proceed any further on this, but the concept seems to me to be robust.

User avatar
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: Skiplink to next post (accessibility)

Post by brunoais »

(just to make sure) You did try that on the current 3.1-dev, right?

philwhite
Registered User
Posts: 18
Joined: Fri Dec 28, 2012 3:09 pm

Re: Skiplink to next post (accessibility)

Post by philwhite »

Er, it didn't cross my mind. Are there any significant differences?

And where can I get the latest build?

User avatar
brunoais
Registered User
Posts: 964
Joined: Fri Dec 18, 2009 3:55 pm

Re: Skiplink to next post (accessibility)

Post by brunoais »

philwhite wrote:Er, it didn't cross my mind. Are there any significant differences?
yes, a whole lot of them. Some parts of the templating system were under a lot of changes, but I don't know if it affects yours.
philwhite wrote: And where can I get the latest build?
https://github.com/phpbb/phpbb3
download as zip.
Check this forum about where you can solve the composer problem.

Post Reply