I recently had a project that required a Page View (using Defaults, of course). The view generated a bunch of names, and because of this, I had to use an Alpha Pager (i.e. - A || B || C || …) to leverage usability concerns. I dodged a bullet this time due to the output consisting solely of names, so numerics were not required, but if they were, how could they be implemented?
For my purposes, I did the following (for names only, that is, but maybe this could be used as a stepping stone for what I’m wanting here):
1.) Created a view that had the “name fields.”
2.) I then needed an argument of type node => name and set it to a glossary configuration using a 1-character limit (which is later used for the Alpha Pager).
3.) In the header space (here is where the actual Alpha Pager comes in), I used the following code I found somewhere on the 'net:
<?php
print l(t('All'), 'names_output') . ' ';
for ($char = ord('a'); $char <= ord('z'); $char++) {
print l(strtoupper(chr($char)), 'names_output' . '/' . chr($char)) . ' ';
} // A-Z pager @bro
?>
All this does is basically output the word “All” and the letters A-Z as links but which get used as arguments for the View’s argument configuration. In other words, it uses the “All” and A-Z links as filters of sorts for the output the view creates. It’s pretty cool considering it doesn’t rely on additional mods or anything. But the only thing remaining is using this same approach to support numerics, which is something I was never able to find any answers on.
SO… I ask the following:
How could numerics be implemented into this approach?
I.e. -
ALL || 0-9 || A || B || C || … || X || Y || Z
(Whereby clicking on “All” outputs everything in the view, clicking on 0-9 [or by expanding it to individual numbers] outputs the respective numeric field value, clicking on the letters, etc.)
Any input / insight into this is appreciated.