Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I just ported a module that uses hook_tokens() and family, and found that there's only a sideways glance to it in the Converting 6.x to 7.x page, and in addition, there's no real handbook or how-to information anywhere that I can find.
I propose these things:
- An entry in the Converting 6.x to 7.x page.
- A handbook page about how D7 tokens work
- A Token Example for D6 and D7 in the Examples module
- Coder module should mark these items.
Comments
Comment #1
gregglesThe token example for D6 is the tokenstarterket.module which is in the token project itself.
Comment #2
rfayThe TOKEN STARTER module has always been an odd duck, showing up for everybody when only developers would be interested. I propose we move it into examples module.
Comment #3
Dave Reid@rfay: Completely agreed. I'll work on the token example today.
Comment #4
gregglesI mostly disagree. A surprisingly large number of people do need to write custom tokens.
Comment #5
rfay@greggles, I'm certainly not advocate getting rid of the Token Starter module, just moving it to a place where it's handy for developers and not obtrusive on production sites.
Comment #6
gregglesAKA a place where it's far less discoverable to the people who need it.
Comment #7
rfayIMO a "TOKEN_EXAMPLE.txt" saying where to find the example and a reference in the readme and a reference in the handbook page would do the job.
When Token first came out, it was really important for that to be shipped with the module, because it was developers that were discovering it. But now it's mainstream, installed on (100's of thousands?) of installations, and the token starter probably just confuses most users.
And remember, Token is in core now, and the standard place for core examples is the Examples module. As you know, they used to go into the contrib/documentation area, but they've moved to where they can be maintained and tested properly.
Comment #8
rfayOf course, there's a tremendously easy compromise: Just do it both places.
Comment #9
jhodgdonMoving to core drupal queue, as that is where we monitor the upgrade pages.
Comment #10
Dave ReidBTW I've started working on http://drupal.org/handbook/modules/token/update/6/7 already.
Comment #11
rfayYour work on token is much appreciated. It would be a horrible backwater without your efforts. Thanks!
Comment #12
jhodgdonWhere are we on this? Assuming we still need an entry in the 6/7 update guide, adding a tag...
Comment #13
jhodgdonOur official position (precedent set by Fields) is that anything that doesn't exist in Core 6.x and now exists in core 7.x does not need to be documented in the 6/7 module update guide page.
So I've added a link at the top of the 6/7 module update page to the page Dave created that documents the changes:
http://drupal.org/documentation/modules/token/update/6/7
Hence, removing the Needs Update Doc tag. I'm not sure what the status of the other parts are:
- Token examples module in Examples for Developers
- Coder module
so I'm leaving the issue open for the moment