Posted by sirkitree on February 26, 2009 at 1:28am
Has anyone come up with a better way of presenting the list of tokens to users? I'm finding that what I'm doing is really ugly and would love to know if anyone has seen any good examples of how to present tokens in a more usable manner.


Comments
three modes I've seen
Crossposted to usability gruop.
The three modes that I've seen people use are:
I've thought some nice additional styles though never implemented them (nor seen them implemented).
Anything else?
--
Growing Venture Solutions | Drupal Dashboard | Learn more about Drupal - buy a Drupal Book
knaddison blog | Morris Animal Foundation
I think a jQuery text filter
I think a jQuery text filter textarea at the top of the list of tokens would be ideal. Just type in 'menu' and the list is immediately pared down to the ones that contain the text 'menu,' and there's still room for the descriptions below each token. There are jQuery plugins that make this really easy, though I've mostly seen them used on table rows.
idea about jQuery text filter
Yes idea about jQuery sounds to be great but for someone who is not using javascripts and jQuery on his side can use dropdown or something else to show tokens.
Popunder? I'm not sure what
Popunder?
I'm not sure what does it call. But the same as Greybox image module. Help dialog popup within the admin page.
Popups
Yes popups would be good for this. Especially combined with the external help page link as greggles mentioned. I think I'll go that route, but I REALLY like the jQuery filter idea too... hrm...
Something like the jQuery
Something like the jQuery Tag Suggestion plugin (http://remysharp.com/2007/12/28/jquery-tag-suggestion/) perhaps?
As for the long list of tokens, maybe we can follow the how Views allows you to Fields filter by categories.
Here's what I've decided
Here's what I've decided upon.
First limit the scope. This cuts down on the amount of tokens as Greg suggests in #2 with the Pathauto style.

Then make each type a collapsible fieldset, resulting in the following:
good job!
I noticed this is what you implemented with activity-2.x, keep up the good work. This method improves productivity by 1000%.
bending technology to fit businesses.
Good to report back on what
Good to report back on what you actually chose to do. Thanks. Seems like a fair solution. Presenting long long, very long lists of stuff is a recurring UI problem and I think you picked the right option for this case.
Only issue with this is that the fieldset titles become very important because that is the only thing you get to base your initial choice on. You might consider dropping the repetitive 'tokens' from all nested fieldset titles, it's pretty clear we're administring tokens already, no need to keep saying it. Omit needless words.
Vertical tabs?
You could make the fieldsets into vertical tabs. That would provide you with some more space for additional information.
Frank
My LinkedIn profile
Token lists? How? Where?
My ultimate goal is to customize Mail Templates that are used when Drupal 5 sends out subscription notices--using tokens to effectively pick and choose which parts of the full node that get sent out to the subscribers.
The standard page for editing a mail template shows a list of tokens (!title, !body, !full_node . . .), but I'm thinking there has to be more than that. The problem is that I don't know how to find or produce a "dictionary" of available tokens.
I've installed the Token module, btw. Apart from a somewhat obscure appearance on the admin/build/modules page, I can see no sign that the module is doing anything.
Is there a script I could just paste (I'm no PHP wizard) into the body of a page that would reveal a dictionary of tokens? I'm especially interested in finding a token for attached files.
Let's focus on improving the
Let's focus on improving the token UI that was planned for core but was too late so it went into Token module (for D6 and D7).
It was really easy to do a better UI for Drupal 7 since we got a very improved token system into core that allows for chaining. You can see how it looks with D7 at my demo site: http://www.davereid.net/d7/examples/token.
We did also backport this tree UI to Token module for Drupal 6, although it does not provide a lot of improvement since there are only so many token 'groups' and a mass of tokens dumped into each group. And because we can't break the existing token API for D6, we can't really change the way this works.
Any module that wants to use the token tree UI in their module should see example code in the Examples or Pathauto modules.
Senior Drupal Developer for Lullabot | www.davereid.net | @davereid
Looks (and works) great!
Wow, that's cool - especially the one-click & scroll-back-into-view feature ;-)
Frank
My LinkedIn profile
token noob
I understand using tokens in titles and certain text fields. Tokens to me work like shortcodes in wordpress. Or at least should in my mind. What I noticed is using the audio module was I could get an album title listed in the title field [audio-tag-album]. Great and super duper.
I tried the same tag in the body field. Nothing.
So, Where can I use tokens and where can I not?
I see this as useful for say triggering an action for a notification liken to the following button on Drupal issues.
With shortcodes in wordpress it's great for non-coders wanting a frame, textbox or whatever complicated java scrpt / jquery in the wysiwyg editor.
Maybe use more so in the rewrite field of views or Panels custom textbox?