CodeIgniter Forums

Full Version: Getting Pagination to pass WAI accessibility validation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]carvingCode[/eluser]
Checking what Cindy Says about the accessibility (508 and WAI) of my pages, I noticed that there was a problem with the defaults the Pagination library uses. The problem (WAI) had to do with no printable character between adjacent links.

Below is what I came up with that satisfied the WAI validator. I used the pipe character as separator, but any printable character will do.

If someone has come up with a better idea (other than not doing anything) I'd be happy to take a look.

Code:
$config['first_tag_open'] = ' | ';
$config['first_tag_close'] = ' |';
$config['last_tag_open'] = '| ';
$config['last_tag_close'] = '| ';
$config['num_tag_open'] = ' | ';
$config['next_tag_open'] = ' | ';
$config['next_tag_close'] = ' ';

Something I would like to do is put these statements someplace else other than repeating them for each separate method that needs them. I tried putting them in the main config files, but that didn't work.

Any suggestions?

TIA

El Forum

[eluser]Aken[/eluser]
There should be no reason why you can't define an array of those key / value pairs in the config file, and call it where appropriate.

It's a shame that WAI can't tell that it's a set of pagination links; I'm sure it wouldn't be so picky about how they're printed if that was the case.