I would like some feedback on the attached patch.

This patch reimplements the alphabet bar.

User interface changes:

  • Only those letters that are actually used are displayed in the alphabet bar
  • Non-letters are also displayed in the alphabet bar (digits, special tokens, etc)

Internal enhancements:

  • The page size has been (much) reduced because only those anchors that are needed are generated; especially when using nested vocabularies, a lot of cruft was generated.

This patch fixes issues 12936, 10645 and 9457.

Note: only toplevel (level 0) terms are indexed.

Future possible improvements (but they would have to be discussed):

  • Copy nested terms to the toplevel
    For example if you have a term Articles with subterms the and a, we could also display the on the toplevel with its parent term or terms between brackets. This way, it could be found in a large glossary list by browsing through it.
  • Display synonyms on the toplevel

Thanks for any feedback,
  Frodo

Comments

slower’s picture

Wonderful. Works just as it should.

One comment: I would suggest actually listing each letter in the alpha bar, but only linking those that had terms associated with them. It looks a little strange to see "a | b | c | d | e | i | l | m | n | o | p | s | t" for the uninitiated. Hopefully the theme would make it more than obvious which letters were "clickable" and which were "empty." I suppose you could even add a span with a title tag to the unlinked letters to say something like "No terms for this letter."

Keep up the great module!

moshe weitzman’s picture

matt's suggestion is an excellent (with or without the tooltip). please add that and then commit.

Frodo Looijaard’s picture

StatusFileSize
new3.39 KB

OK, I have committed this to CVS, minus the tooltips.

If there is any term starting with a letter (a-z, case insensitive), all letters are generated in the alphabar.
If there is any term starting with a digit (0-9), all digits are generated in the alphabar.
Adding more rules like this is as easy as extending an array.

I have attached the patch I used for your information.

Let me know if you find any problems!

Thanks for the feedback,
  Frodo

Anonymous’s picture