I'd like to create some tokens for arg(0), ... arg(3) as [arg0], [arg1], ... [arg3]. I'm not really sure where to start. I'm thinking I need to add a new file, e.g. token_url.inc, implement the hooks, e.g. url_token_values and url_token_list and add a require_once for the new file in token_include.
I'm pretty sure I'll need to add something like $values['arg0'] = args(0); and $tokens[?]['arg0'] = t('Argument 0'); The problem is I don't know what to put in for the first dimension of $tokens, and I don't know what to expect in the $type argument (e.g. the switch ($type) and if ($type == ? || $type == 'all') statements).
Any help appreciated (I know there is another issue marked as postponed for this feature http://drupal.org/node/273893, but I could really use this feature for a site I'm developing right now -- I don't mind having to upgrade later to support a better implementation -- and it seems like it should be fairly easy to implement).
Thanks.
Colin
Comments
Comment #1
gregglesHi Colin,
You're headed down the right path. I think that the $type for those should be "all" since they should be available in general.
I'm marking this "fixed." Since I think this answers your question. Don't let the "postponed" status deter you from working on the code in that other issue. Once you've built the code you can attach it to that issue for discussion even if it is "postponed." And follow up (in the other issue is probably better) if you have any more questions.
Comment #2
colin_young commentedThanks. I'll do any follow-up over there (my assumption is that "postponed" just means the official developers don't have the time to implement it now, but would like to see it in the future).
Comment #3
gregglesYeah...postponed can many things depending on which issue queue it is in. In this case, it means what you said and also perhaps that we need investigation into something which will require lots more work.