If you want to build specific token help for say a node and a user you must call theme('token_help') twice with each namespace. Unfortunately this results in getting the global token help twice.

This function should be changed to either take an explicit array of namespaces to retrieve or a 'global' namespace should be added.

Comments

fago’s picture

I agree. I have the same problem with workflow-ng, where 'global' is appearing again and again.

I could do a patch for this. Which solution is preferred?

a) make the inclusion of the global tokens optional
b) remove the inclusion of global tokens
c) or an array based variant, but there I'd need also configurable prefixes/suffixes per type, which might get a bit more complicated

I think, a) would make most sense.

dldege’s picture

Could global just be another namespace with no special handling?

That is if you want user help and glaoabl help you would call it with each namespace. Another idea is to have the function take an array of namespaces for a parameter instead - like
token_help(array('global', 'user', 'node'));

What do you think?

drewish’s picture

perhaps http://drupal.org/node/163275 is a duplicate of this... it's got a patch though...

drewish’s picture

no, never mind, after reading this carefully you're looking for multiple objects, not a specific object.

fago’s picture

hm, but the given node is seldom available on configuration time. I would love to be able to state the used node type, for which then I get the replacements.

fago’s picture

damn wrong issue, forget my comment #5!

greggles’s picture

My solution in pathauto was only to interact with the token_list directly and not theme_token_help.

I think the array solution looks best to me which involves requiring the 'global' explicitly, right?

dave reid’s picture

Status: Active » Closed (duplicate)

We now have the token tree available for Drupal 6, which can list multiple types easily.

dave reid’s picture

Version: 5.x-1.x-dev » 6.x-1.x-dev
Status: Closed (duplicate) » Fixed

I should probably just mark this as fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.